[cpp-threads] Re: Thread API interface tweaks

Ion Gaztañaga igaztanaga at gmail.com
Fri Sep 1 23:11:01 BST 2006


> > 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? I promise that this is
my last try to make this type of code correct ;-)

Regards,

Ion



More information about the cpp-threads mailing list