I would like to know once the thread is done processing something, is it better to put the thread back or to discard the thread?
Does ThreadPool uses a Queue internally to store Threads and give it to process which requests a thread?
I looked at C# impl of thread, source code, hard to understand it. I d like to know if there is a easier implementation to understand how thread pool works and internal details.
If you want to know if you should put the thread back in the pool or discard it you need to know your use of the thread pool. For instance, is the cost of creating a new thread greater than managing it in the thread pool and it will be used in a timely manner, then keep it in the pool. But I wouldn’t keep it in the pool if it won’t be used for 5 days.