Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-06-28 16:48:42


From: John Max Skaller <skaller_at_[hidden]>
> 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.

Right. You would have to unblock it first.

> It is a core language issue whether destructors
> are run when a thread is cancelled.

Yes, which is one reason I think we want to punt.

> > 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.

Yes, it can be effective.

> FYI the design supports distribution, replication,
> and recovery, all while the DB remains operational.

A familiar set of requirements. Oracle uses process on
some platforms, threads on others, depending on what is
available and how well it performs.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk