This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp] new critical section functions in libgomp
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 Sep 2005 02:23:10 -0400
- Subject: Re: [gomp] new critical section functions in libgomp
- References: <20050921231507.GA10803@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Sep 21, 2005 at 04:15:07PM -0700, Richard Henderson wrote:
> When actually implementing the front/middle -end bits, I found it
> less than convenient to actually deal with omp_lock_t. So I punted
> and created libgomp functions that didn't require it.
Can't you optimize this for the cases where
sizeof (gomp_mutex_t) <= sizeof (gomp_mutex_t *) \
&& __alignof (gomp_mutex_t) <= __alignof (gomp_mutex_t *) \
&& defined (GOMP_MUTEX_INIT_0)
by not using the indirection in that case in GOMP_critical_name_*?
I know it uglifies the 2 routines, on the other side you avoid the malloc
calls etc.
GOMP_MUTEX_INIT_0 would be something similar to how glibc specializes
mutex inits. E.g. initialize_critical could be #ifndef GOMP_MUTEX_INIT_0
as well.
> * critical.c (GOMP_critical_name_start, GOMP_critical_name_end): New.
> (create_lock_lock): New.
> (initialize_critical): Initialize it.
> * libgomp.map (GOMP_critical_name_start, GOMP_critical_name_end): New.
> * libgomp_g.h (GOMP_ordered_start, GOMP_ordered_end): Declare.
Jakub