what does reuse thread meaning -- call thread.Start() again to execute same threadStart again?

  • Thread starter Thread starter Ryan Liu
  • Start date Start date
R

Ryan Liu

How a thread is reused in thread pool?

Change the context and call theThread.Run() again, and it executes same
threadStart?

Thanks!
Ryan
 
The ThreadPool works with a callback mechanism.
When you call QueueUserWorkItem (For example) you specify a WaitCallback.
When a threadpool thread becomes available, it processes your call, and you
get the result in the callback. At that point the thread is finished with the
workitem and is now available to accept another that's been put in the queue.
Thread.Start has nothing to do with the Threadpool.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Thread GC collection 6
threading 2
wrong 2
Threading 8
Works just as good without the Threadstart 3
timer/threading 10
How to deal with this thread? 4
Anonymous methods, captured variables and the Thread Pool 1

Back
Top