[cpp-threads] Re: Thread API interface tweaks

Alexander Terekhov alexander.terekhov at gmail.com
Sun Sep 3 13:42:33 BST 2006


On 9/2/06, Ion Gaztañaga <igaztanaga at gmail.com> wrote:
> > > Sorry if I'm wrong, but does not thread creation/destruction involve
> > > memory synchronization? Hasn't pthread_create() release sematics and
> >
> > http://www.opengroup.org/austin/mailarchives/ag-review/msg02017.html
> >
> > > pthread_join() acquire semantics? So if a thread ends all previous
> > > operations shouldn't be completed (including writing an invalid
> > > thread_id)?
> >
> > You seem to make assumptions. Suppose that a thread doing unlock() is
> > a POSIX detached thread so you just can't join it.
>
> Ok. Thanks. But know the next question for a dumb programmer like me
> is: why don't we request a release() operation when the executed
> thread function ends, without depending on a pthread_join(). Wouldn't
> a final release() operation solve the problem?

Not without acquire. A requirement imposed on implementations for
thread id re-use to have acquire/join effect would solve it (in
addition to thread termination having release effect).

regards,
alexander.



More information about the cpp-threads mailing list