I am using .NET 3.5 and am trying to wrap my head around a problem (not being a supreme threading expert bear with me).
I have a windows service which has a very int
The BackgroundWorker is a bit slower than using plain threads, but it has the option of supporting the CancelAsync method.
Basically, BackgroundWorker
is a wrapper around a worker thread with some extra options and events.
The CancelAsync
method only works when WorkerSupportsCancellation is set.
When CancelAsync
is called, CancellationPending is set.
The worker thread should periodically check CancellationPending
to see if needs to quit prematurely.
--jeroen