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 Wed, Sep 28, 2005 at 05:28:51AM -0400, Jakub Jelinek wrote:
> +        if ((copyprivate_p = GOMP_single_copy_start ()) == NULL)
> +         {
> +           body;
> +           copyout_seq;
> +           GOMP_single_copy_end (&copyprivate);
> +         }
> +        if (copyout_p)
> +         {
> +           copyin_seq;
> +         }
> +        GOMP_barrier ();
> +      */
> 
> I don't think the GOMP_barrier () there is needed.

I'll give you the same waterfall as I just gave Diego:

	thread1			thread2
	single_copy
	body
				single_copy
	copy_end
	if copyout_p
				if copyout_p
	return
	clobber stack
				copyin garbage


> Which reminds me, Richard, any reason why GOMP_barrier etc.
> doesn't use pthread_barrier_wait on targets that support it?

I didn't know about it.  The glibc version at least looks a 
good bit more efficient than the mechanism that I'm using.
I'll think about how to arrange things such that the source
doesn't get too gross when it's not available.


r~


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