How to force a thread to unwind it's stack?
Sascha Katzner
sorry.no at spam.invalid
Wed Aug 27 08:04:34 PDT 2008
Why is there no way in D to force a thread to unwind it's stack, for
example by sending it an exception like you do in Java with
"Thread.interrupt()"?
Suppose you have an application which has a thread that has some
important resources which need to be released before the application can
quit and this thread is currently busy with something which is out of
your sphere of influence (like waiting for a network packet or
something), so that in the foreseeable future it can't look for a flag
of the main thread to quit and release it's resources. How do you force
this thread to terminate without compromising the resources it holds or
having to release the resources manually in the main thread?
Here is an example of how D could implement this stack unwinding:
"http://www.woodmann.com/crackz/Tutorials/Seh.htm#Exception handling in
multi-threaded applications" (8th point)
LLAP,
Sascha
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.d
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20080827/1d772390/attachment.ksh>
More information about the Digitalmars-d
mailing list