Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-08-13 08:25:03

From: "William E. Kempf" <williamkempf_at_[hidden]>
> Who knows what caused the exception? Is that relevant? And I don't
> I said that exception propogation was in effect for the writer thread...
> though I see why you think that could make a difference. Maybe not the
> example because this can lead to the confusion you're having. I didn't
> envision the writer thread as returning anything. But in that case you'll
> say the user would likely be handling the exception correctly. OK, let's
> say it's the reader that throws. Now when the writer fills up the buffer,
> it to will deadlock.

I think I understand. For some reason, the reader thread throws an
unexpected exception. The writer thread fills up the buffer and blocks. The
main thread, for some reason, doesn't join() the reader thread, the
exception is lost, the writer remains blocked. You opinion is that an
abnormal program termination in this case is a better response.

This is a valid concern, but it's possible to have the cake and eat it, too.
Provide the "unsafe" interface, where thread<R> propagates, as an
experiment. Wait for user feedback. Obtain real data on whether the mistakes
caused by this behavior are a significant problem, and not a small part of
the vast majority of thread-related errors. Nobody argues with real data.

Boost list run by bdawes at, gregod at, cpdaniel at, john at