|
-
October 11th, 2007, 01:16 PM
#2
Re: Killing threads
I am not sure I completely understand how 'throw'ing while your thread which may be preparing to make a kernel call really differs much from just terminating it in terms of safety and releasing all mutexes properly.
The only portable solution for the analysis routine seem to make it out-of-process. Which will depend on application complexity, but then again the application complexity appears to be very high because you have not opted for a state-machine or tried putting wrappers around any calls that can take a long time to complete. A brief hunt into the land of the CONTEXT structure reveals only portability problems and more danger.
Perhaps if the worker-thread was made responsible for keeping a collection of all objects it opens, (a garbage can if you like) so that the "killer" can come along afterwards and clean them all up if ever it has to do any dirty-work.
(edit)
Looking again, I am imagining the exception is getting-handled by someone else's handler, hence the problem?
Last edited by Conrad Braam; October 11th, 2007 at 01:19 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|