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.
 
Back
Top