Boost logo

Boost :

From: Darryl Green (green_at_[hidden])
Date: 2002-08-27 20:11:25


> -----Original Message-----
> From: Alexander Terekhov [mailto:terekhov_at_[hidden]]
>
>
> Darryl Green wrote:
> >
> > I still don't get it. What exactly is the point you are
> trying to make? Are
> > you suggesting that one should or shouldn't,
>
> I'm suggesting that one shouldn't (no matter whether it can
> be done or not,
> "conformance" aside for a moment).
>

Ok - I understand that suggestion - and I agree to the extent that I don't
think it is always a good thing to do. I just happen to think it is not
always a bad thing to do.

> > can or can't write a terminate
> > handler that terminates the thread but not the process and
> is such a program
> > conforming or not?
>
> Well, let me put it this way: feel free to fool yourself into
> believing that
> it's somehow going to make your application safer/robuster
> ("better"), using
> the following {anti-}"pattern":
>
> < illustration only; NOT "real" code, but it doesn't screw up
> terminate(),
> "at least" >

Screw up terminate()? This is where I don't understand your posts - I can't
see that there is anything defined about what happens after the call (except
that it won't return) so how can it be "screwed up"?

>
> extern "C" void* thread_routine_wrapper( void* arg )
> {
> try {
> return call_something( arg );
> }
> catch( const pthread_cancel_e& ) { throw; }
> catch( const pthread_exit_e& ) { throw; }
> catch( ... ) {} // ignore
> return "HI_THERE_COMMA_TAKE_THIS_UNCAUGHT_EXCEPTION";
> }
>

Thanks. I will (sometimes).

> regards,
> alexander.
>


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