From: John Max Skaller (skaller_at_[hidden])
Date: 2001-06-28 16:34:05
Greg Colvin wrote:
> To be clear, just stopping a thread "out of nowhere" is
> a bad idea, as there is then no way to get out of any
> monitors it has entered. Better is a way to throw an
> exception on the thread, so as to let destructors run.
You did not meet the requirements.
The thread is blocked. It cannot throw anything.
It is a core language issue whether destructors
are run when a thread is cancelled.
> Sometimes it is even better to spawn processes instead
> of threads, so the OS can take care of cleaning up a
> killed process.
Sometimes it is. And sometimes not.
I have seen the application in question, a very sophisticated
database. The designer is an expert. He swears by cancellation.
FYI the design supports distribution, replication,
and recovery, all while the DB remains operational.
-- John (Max) Skaller, mailto:skaller_at_[hidden] 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 New generation programming language Felix http://felix.sourceforge.net Literate Programming tool Interscript http://Interscript.sourceforge.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk