J
Joe Jax
I have an object that spawns a worker thread to process one of its methods.
That method processes methods on a collection of other objects. During this
processing, a user may request to cancel the entire operation. I could
request abort on the worker thread, but that is a) potentially messy, and b)
not guaranteed to take immediate effect anyway. I would rather have some way
of allowing the main thread to tell the worker thread that it should stop.
The code being executed by the worker can then check periodically for a stop
request. An added complication is that this should be compatible with
ASP.NET, meaning that any use of static variables needs special
consideration.
I'd be grateful for any advice.
That method processes methods on a collection of other objects. During this
processing, a user may request to cancel the entire operation. I could
request abort on the worker thread, but that is a) potentially messy, and b)
not guaranteed to take immediate effect anyway. I would rather have some way
of allowing the main thread to tell the worker thread that it should stop.
The code being executed by the worker can then check periodically for a stop
request. An added complication is that this should be compatible with
ASP.NET, meaning that any use of static variables needs special
consideration.
I'd be grateful for any advice.