From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2005-08-03 05:45:05
Jonathan Wakely wrote:
> Jonathan Turkanis wrote:
> > Pavel Vozenilek wrote:
> > > "Jason Hise" wrote:
> > >
> > >>> http://www.boost.org/doc/html/call_once.html?
> > >>>
> > >> Why does it require that the function which is called once not be
> > >> allowed to throw? I am not sure that I can meet this requirement,
> > >> as I may need to dynamically allocate memory.
> > >>
> > > Possibly because of internal implementation.
> > I think it's a pthreads requirement.
> Pthreads knows nothing about exceptions,
That's not true.
"The pthread_once() function is not a cancellation point. However, if
init_routine is a cancellation point and is canceled, the effect on
once_control shall be as if pthread_once() was never called."
"Note that the specified cleanup handling mechanism is especially tied
to the C language and, while the requirement for a uniform mechanism
for expressing cleanup is language-independent, the mechanism used in
other languages may be quite different. In addition, this mechanism
is really only necessary due to the lack of a real exception
mechanism in the C language, which would be the ideal solution."
"...it is an explicit goal of IEEE Std 1003.1-2001 to be compatible
with existing exception facilities and languages having exceptions."
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk