This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Race unlocking-locking mutex
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Godmar Back <godmar at gmail dot com>, Rich Felker <dalias at aerifal dot cx>
- Cc: "Carlos O'Donell" <carlos at systemhalted dot org>, David Ahern <dsahern at gmail dot com>, "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Fri, 13 Sep 2013 15:19:48 -0400
- Subject: Re: Race unlocking-locking mutex
- Authentication-results: sourceware.org; auth=none
- References: <5231ECBE dot 4030006 at gmail dot com> <CAB4+JY+dBDVhk9UJWXRXrxF5BhoTFXv==_v+ibdEBU5Noj4aEw at mail dot gmail dot com> <5231F2C3 dot 6080305 at gmail dot com> <CAE2sS1gp9Z5b5qoSqgBXbbL-S+_fHaL1PN7z=CfMsqSTA=7LFg at mail dot gmail dot com> <CAB4+JY++Zs_kKN32oWKvy1i-HQOHZQsosBSUBc3=YrXA_S96Hw at mail dot gmail dot com> <523349A3 dot 7000501 at redhat dot com> <CAB4+JYLZ5ayNWD8UmfhF51v112LfuJQLUUf1CH4eKdesgRHNsA at mail dot gmail dot com>
On 09/13/2013 01:33 PM, Godmar Back wrote:
> The standard says:
> "The need to hold spin lock overhead to an absolute minimum also
> makes it impossible to provide guarantees against starvation similar
> to those provided for mutexes or read-write locks."
>
> What starvation guarantees are they talking about? I thought it meant
> that an implementation is required to use a FIFO policy if multiple
> SCHED_RR/SCHED_FIFO threads of *equal* priority are queued on a
> contended lock.
>
> But I also haven't been able to find it explicitly saying so.
I've never seen any guarantees against starvation.
Rich,
Including you here to pick your brain. Has POSIX ever guaranteed
that mutexes or read-write locks are free of starvation?
Cheers,
Carlos.
P.S.
Please avoid top-posting, it's not the common practice here.
We use bottom/inline posting with trimming as appropriate to make
the point clear.