
Jonathan Wakely <cow@compsoc.man.ac.uk> writes:
Jonathan Turkanis wrote:
Pavel Vozenilek wrote:
"Jason Hise" wrote:
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, so it can't strictly require that one isn't thrown :-)
It's also a 'C' library so *in general* it can't propagate an exception properly either. I'm pretty sure that's the reason for the requirement. In principle, it might crash. Of course, some systems have integrated C++ exceptions with their 'C' runtime and libraries. In fact, pthreads is more likely than most libraries to have registered the appropriate 'C' cleanups, because pthreads has a whole integrated cancellation mechanism that is intended to map to C++ exceptions. -- Dave Abrahams Boost Consulting www.boost-consulting.com