[cpp-threads] pthreads cancellation

Alexander Terekhov alexander.terekhov at gmail.com
Thu Apr 28 09:11:47 BST 2005


On 4/27/05, Andrei Alexandrescu <andrei at metalanguage.com> wrote:
[...]
> That also reminds me of something else. We need to define what the
> threading behavior for various standard lib functions is, particularly
> potentially blocking functions such as I/O. That is essential to writing
> proper shutdown code.

Simply adopt pthread lists of "shall occur" and "may occur" cancellation  
points. Making cancel delivery behave intelligently (vs silly forced 
unwinding misguidedly prescribed by one quite popular C++ ABI)

   if (cancel_enabled() && cancel_request_pending()) () {
     disable_cancel();
     throw_if_expected std::thread_cancel_request();
     enable_cancel();
   }

would be the real step forward, but it requires quite thorough
overhaul of C++ EH (mandatory 2-phase with fixed ES).

regards,
alexander.




More information about the cpp-threads mailing list