|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2000-08-11 07:04:40
----- Original Message -----
From: "Reid Sweatman" <borderland_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, August 10, 2000 10:49 PM
Subject: RE: [boost] Re: Threads by Jeremy and Monitors in one?
> > -----Original Message-----
> > From: Thomas Holenstein [mailto:tholenst_at_[hidden]]
> > Sent: Wednesday, August 09, 2000 4:25 PM
> > To: boost_at_[hidden]
> > Subject: Re: [boost] Re: Threads by Jeremy and Monitors in one?
>
> > If some people want a timeout, I'd suggest throwing an exception after
> > a specified time.
>
> Seems to me this would be a misuse of exception, since it's *expected*
> behavior, not a violation of the class contract.
"Expectedness" is a poor measure of whether an exception is the appropriate
response, IMO. In some sense, any error you can write recovery code for is
"expected". The criterion to use is "will the caller almost certainly want
to handle the condition locally, or is stack unwinding more likely to be the
desired behavior?"
-Dave
P.S. In this case, I agree that an exception is probably not appropriate.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk