This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #19490] Add unwind descriptors to pthread_spin_init, etc. on i386
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Torvald Riegel <triegel at redhat dot com>, Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>, <nd at arm dot com>
- Date: Mon, 1 Feb 2016 12:26:03 +0000
- Subject: Re: [PATCH][BZ #19490] Add unwind descriptors to pthread_spin_init, etc. on i386
- Authentication-results: sourceware.org; auth=none
- Nodisclaimer: True
- References: <CALoOobPJLwc+iSG+w-2YqqiL6=iAL-ZPiS5iKtmdDmJTR9Fp6g at mail dot gmail dot com> <1453727190 dot 4592 dot 91 dot camel at localhost dot localdomain> <CALoOobP6+GGSCMwiXsgQY4zLCXKpSsOA=4fOdB+J9q20bmtWOw at mail dot gmail dot com> <1454326614 dot 4592 dot 293 dot camel at localhost dot localdomain> <56AF49AD dot 5020108 at arm dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
On 01/02/16 12:03, Szabolcs Nagy wrote:
> the current unlock is not enough for posix if trylock is
> acquire MO:
>
> T1:
> unlock(l1);
> if (trylock(l2))...
>
> T2:
> unlock(l2);
> if (trylock(l1))...
>
> with one sided barrier, both trylock can fail to grab
> the lock (the loads are not guaranteed to happen after
> the stores) which is not seq cst, this does not happen
> with release MO unlock.
>
sorry, acquire/release MO is not enough to fix this
in c11, on the hw level i believe it is enough with
arm memory model.