[cpp-threads] Asynchronous Execution Issues

Alexander Terekhov alexander.terekhov at gmail.com
Tue Apr 28 01:09:21 BST 2009


On Mon, Apr 27, 2009 at 11:17 PM, Peter Dimov <pdimov at mmltd.net> wrote:
[...]
>> pthread_attr_settermnotify().
>>
>> http://www.rdg.opengroup.org/austin/mailarchives/ag/msg04445.html
>
> This is basically Anthony's (3), right?

"Provide a means for a thread to register a single function to be
called after thread_local objects have been destroyed. It is undefined
behaviour for that function to access thread_local objects, but it may
call library functions. This function could then set the "done" flag."

Sort of. Except that the notification function may live in the context
of the creating thread. Think of a thread doing a dlopen() and
pthread_create() another thread with its start_routine taken from
dlsym() and calling dlclose() on that thread termination.

regards,
alexander.



More information about the cpp-threads mailing list