[cpp-threads] Asynchronous Execution Issues

Peter Dimov pdimov at mmltd.net
Mon Apr 27 22:17:06 BST 2009


> http://www.rdg.opengroup.org/austin/mailarchives/ag/msg04453.html
>
> (Quoting Butenhof.)
>
> -----
> Perhaps we could even begin to suggest that we could be seeing some
> sort of consensus?
>
> 1. We need to strengthen pthread_join() to require that the joiner is
> awakened after the terminating thread's resources have been
> "stablized". All cleanup handlers and TSD destructors are done,
> and the thread is no longer executing on its stack. If the stack
> is application-managed, the application is able to free or reuse
> the stack; if the stack was implementation-managed, the resources
> will be available to reuse in future thread creations. (Though we
> probably shouldn't try to guarantee that the stack MUST be reused
> immediately.)

Interesting. I didn't know that POSIX doesn't guarantee it. So the only 
proper way to use TLS is never to refer to anything non-thread-local from 
the destructor.

> pthread_attr_settermnotify().
>
> http://www.rdg.opengroup.org/austin/mailarchives/ag/msg04445.html

This is basically Anthony's (3), right?




More information about the cpp-threads mailing list