how to cancel a thread that is in threadpool

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I would like to cancel or abort the execution of a thread that has been added to the queue of the threadpool. It seems that once it has been added, I don't have any access or control over it. Any help is appreciated

Regards

A
 
Hi,

I would like to cancel or abort the execution of a thread that has been added to the queue of the threadpool. It seems that once it has been added, I don't have any access or control over it. Any help is appreciated.

Regards,

A

You can't... The most you can do with a thread pool thread is set a
flag that the thread has access to that tells it to abort.

The threadpool class is best uses with short lived jobs that don't
require much user interaction :) If you need better control of the
threading process, your much better off using a System.Threading.Thread
object.
 

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


Back
Top