This is the mail archive of the
mailing list for the GCC project.
Re: libgomp: gomp_ptrlock*() specification
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 8 Jul 2015 22:05:18 +0200
- Subject: Re: libgomp: gomp_ptrlock*() specification
- Authentication-results: sourceware.org; auth=none
- References: <687646756 dot 210075 dot 1436384203738 dot JavaMail dot zimbra at embedded-brains dot de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Jul 08, 2015 at 09:36:43PM +0200, Sebastian Huber wrote:
> from the use cases in libgomp it seems that you may set the value of a
> ptrlock object at most once via gomp_ptrlock_set() if it wasn't already
> initialized to a non-NULL value via gomp_ptrlock_init()? Is this correct?
Please see https://gcc.gnu.org/ml/gcc-patches/2008-03/msg01278.html
> Why is there a specialized Linux implementation? Is this to save one extra integer for the mutex?
Not just that, it is simply significantly more efficient, which is very
important for such a frequently used synchronization primitive.
You are free to define it for some other target also efficiently.