Barriers hanging

Sebastien Decugis sebastien.decugis at ext.bull.net
Thu Feb 19 17:20:07 UTC 2004


> > Having said this, I did make some changes which are far less intrusive
> > and which still guarantee that no pthread_barrier_destroy succeeds if
> > there is still a thread which hasn't returned from a previous
> > pthread_barrier_wait call. 
> 
> I think this is far better.
> 
Sorry for this, I had not understood your changes. It appears to me that
with your new version, pthread_barrier_destroy will return only once
every other threads exits pthread_barrier_wait. This is basically what I
wanted, but I agree this is not implied by the POSIX spec.

Anyway, i think the following assertion

> "[EBUSY]
>         The implementation has detected an attempt to destroy a barrier
>         while it is in use (for example, while being used in a
>         pthread_barrier_wait() call) by another thread"

was not OK with the previous pthread_barrier_wait / _destroy

I think that if you modify your tst-barrier4.c with looping on
pthread_barrier_destroy() while return code == EBUSY, you will have a
POSIX conformance test, won't you?


Best regards,
Sébastien Decugis.





More information about the Phil-list mailing list