This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] New condvar implementation that provides stronger ordering guarantees.
- From: Torvald Riegel <triegel at redhat dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>, nd at arm dot com, "Carlos O'Donell" <carlos at redhat dot com>, David Miller <davem at davemloft dot net>, Darren Hart <dvhart at infradead dot org>
- Date: Fri, 27 May 2016 14:10:41 +0200
- Subject: Re: [PATCH] New condvar implementation that provides stronger ordering guarantees.
- Authentication-results: sourceware.org; auth=none
- References: <1464268895 dot 17104 dot 14 dot camel at localhost dot localdomain> <574833A7 dot 7050705 at arm dot com>
On Fri, 2016-05-27 at 12:46 +0100, Szabolcs Nagy wrote:
> On 26/05/16 14:21, Torvald Riegel wrote:
> > diff --git a/sysdeps/aarch64/nptl/bits/pthreadtypes.h b/sysdeps/aarch64/nptl/bits/pthreadtypes.h
> > index 13984a7..87c4804 100644
> > --- a/sysdeps/aarch64/nptl/bits/pthreadtypes.h
> > +++ b/sysdeps/aarch64/nptl/bits/pthreadtypes.h
> > @@ -90,17 +90,32 @@ typedef union
> > {
> > struct
> > {
> > - int __lock;
> > - unsigned int __futex;
> > - __extension__ unsigned long long int __total_seq;
> > - __extension__ unsigned long long int __wakeup_seq;
> > - __extension__ unsigned long long int __woken_seq;
> > - void *__mutex;
> > - unsigned int __nwaiters;
> > - unsigned int __broadcast_seq;
> > + __extension__ union
> > + {
> > + __extension__ unsigned long long int __wseq;
> > + struct {
> > + unsigned int __low;
> > + unsigned int __high;
> > + } __wseq32;
> > + };
> > + __extension__ union
> > + {
> > + __extension__ unsigned long long int __g1_start;
> > + struct {
> > + unsigned int __low;
> > + unsigned int __high;
> > + } __g1_start32;
> > + };
>
> are these __low/__high members needed (i dont see them used)?
> they may be misleading on bigendian targets.
They are used on archs that provide only 32b atomics (in which case the
aliased 64b value is not used, so no endianness problems). I've kept
them in the declarations on archs with 64b atomics because ...
> the type definition seems to be similar across targets,
> maybe it could be shared in some generic header?
... I want to make this sharing easy. I haven't done it right now, but
we can look at it as a follow-up. This would apply to other definitions
in pthreadtypes.h too, so it seems a non-condvar-specific cleanup would
be best.