Some questions about the interface IDisposable
and using
already exist, for example:
What types of features are released in a using statement
I should always use the dispose
I'm still not sure what to do about threads .
In my idea if the object uses some thread explicitly, it makes perfect sense to ensure this thread ends with the use of thread.join()
for example. >
This would serve to ensure there is no work to be done in background but would also decrease the resources (in this case CPU) used by this threads .
In addition I also made sure that threads would be in a known state (terminated) instead of being in an unknown state.
I know that the CPU is not a resource that can be reserved by thread and that there is nothing to guarantee that my thread is using it. p>
But my premise is as follows: If I can assure you that there is no work to be done on threads , why not do it?
What should I do anyway? Should I make sure my threads end or not?