This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gomp] Fix omp single


On September 28, 2005 13:34, Richard Henderson wrote:
> On Wed, Sep 28, 2005 at 08:09:06AM -0400, Diego Novillo wrote:
> > There isn't a barrier at the end of thread bodies as I thought
> > there was.
>
> If you return from the __omp_fn.N function, there is indeed a
> barrier: either in libgomp or in GOMP_parallel_end.

But the barrier is after the stack's been clobbered.  So, even the 
simpler

#pragma omp parallel
{
	#pragma omp single copyprivate (x)
	x = ...
} <== B

will fail.  In my mental image, I kept putting the barrier at B, before 
the body of the parallel gets a chance to undo the stack (old habits 
die hard).  If the thread that entered omp single goes out too fast and 
it passed x by address to its siblings, we lose.

I suspect the horse is quite dead now ;)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]