• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 659
  • Last Modified:

ThreadPool and worker threads

Hi Experts,

I have a ThreadPool and I want to know if I use Thread.Suspend(): is the Thread put in the queue or is it always one of the 25 working threads ?
If not, how can I put this thread back in the queue and let other threads execute ?

Thanks in advance for your help.
  • 2
1 Solution
if you are calling a thread that is *already* in the ThreadPool then you should be "done" as you are only referencing the thread not 'pulling it from the queue'.  the other threads would be indipendant of that thread unless your telling the ThreadPool to suspend all threads...
nouloukAuthor Commented:
Thanks ShakbotOK,

Ok, suspend function will stop the thread and another thread from the queue will be inserted in the ThreadPool.
In fact, I want to know if I pause the thread, will this paused thread be put in the queue and let another thread execute ?
Ah... you mean if you have a ThreadPool limit of 20 and suspend #20 can #21 execute?  I do not beleive so...

A paused thread is still a active thread with pending processing instructions... so it would count as a active thread.... HOWEVER it should not stop any of the other threads from being able to process.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now