Message from discussion
Ordering of sem_wait waiters
Received: by 10.68.223.40 with SMTP id qr8mr2241595pbc.0.1336042231526;
Thu, 03 May 2012 03:50:31 -0700 (PDT)
Path: r9ni126992pbh.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From: Noob <r...@127.0.0.1>
Newsgroups: comp.unix.programmer
Subject: Re: Ordering of sem_wait waiters
Date: Thu, 03 May 2012 12:50:45 +0200
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <jntntm$cgn$1@dont-email.me>
References: <jn94hj$d93$1@dont-email.me> <jnqs4o$o1r$1@dont-email.me> <87bom6dekl.fsf@sapphire.mobileactivedefense.com>
Mime-Version: 1.0
Injection-Date: Thu, 3 May 2012 10:50:30 +0000 (UTC)
Injection-Info: mx04.eternal-september.org; posting-host="qOOJ7oSlu3pYhSFGtIVsxw";
logging-data="12823"; mail-complaints-to="ab...@eternal-september.org"; posting-account="U2FsdGVkX19vy91YfdY2pW/5mYwGGm7DXkvVyQKF9+8="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120312 Firefox/11.0 SeaMonkey/2.8
In-Reply-To: <87bom6dekl.fsf@sapphire.mobileactivedefense.com>
Cancel-Lock: sha1:+iqj6W2wXxiD3qrYnIzYHgfJ0ow=
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Rainer Weikusat wrote:
> Noob <r...@127.0.0.1> writes:
>> Noob wrote:
>>
>>> The (proprietary) OS I've been working with provides two "types"
>>> of semaphores: fifo or prio. They differ in how callers of the
>>> wait function are handled.
>>>
>>> When the semaphore count is 0, callers of wait on a fifo semaphore
>>> are stored in FIFO order in the wait queue, without consideration
>>> for the thread's priority.
>
> [...]
>
>>> Looking at POSIX semaphores, and sem_wait specifically, I'm
>>> wondering what kind of strategy is implemented on typical
>>> POSIX platforms, and on recent Linux kernels?
>>
>
> [...]
>
>> Would anyone care to comment?
>
> Hmm ... what kind of comment do you expect?
I was expecting something along the lines of: "POSIX indeed
leaves the behavior of sem_wait up to the implementation" and
"Yes, recent Linux kernels do implement a prio semaphore".
(Or the opposite.)
Regards.