Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-09 17:25:53


From: "William E. Kempf" <wekempf_at_[hidden]>
> > From: "Peter Dimov" <pdimov_at_[hidden]>
> > > (And is it useful to distinguish between memory and other resource
> > errors?)
> >
> > This, I have no ready answer for... but "when in doubt, do what POSIX
does."
>
> Why (in regards to "do what POSIX does")? They can make mistakes as
easily
> as the rest of us.

Because they've had the time to find and correct their mistakes, I'd expect.
:-)

> If we do seperate them, is there any reason to provide a thread specific
memory
> exception, or should we use std::bad_alloc?

Good question. I'll face the same problem when I finally decide to fix the
POSIX lightweight_mutex to check for error returns. :-) [As a side note, do
you plan to integrate lightweight_mutex into Boost.Threads?]

I'm not sure which piece of information is more important here, the "no
memory" part or the "this is a thread exception" part, although I'm leaning
towards a std::bad_alloc derived exception (boost::posix_enomem?
boost::thread::out_of_memory?)

> > An error code (OS or portable) can be of help when one needs to catch
all
> > thread-related (or better yet, all error code providing) exceptions in a
> > single catch clause. Usually this is only needed to report an error,
though,
> > so if thread exceptions provide some other common mechanism to identify
the
> > error (like specific what() values), carrying an error code won't be
> > necessary.
>
> And would the above mentioned "localized message" be enough to satisfy
this
> requirement?

I think that it would be enough for my needs. Can't speak for others.


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