From: Peter Zijlstra <peterz@infradead.org>
To: Raz <raziebe@gmail.com>
Cc: Manfred Spraul <manfred@colorfullife.com>,
linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Lior Brafman <LBrafman@manz.com>,
Torsten Scherer <TScherer@manz.com>,
Rasty Slutsker <RSlutsker@manz.com>
Subject: Re: Subject: [PATCH 2/2] priority System V Semaphores
Date: Thu, 22 Dec 2011 15:00:57 +0100 [thread overview]
Message-ID: <1324562457.24803.24.camel@twins> (raw)
In-Reply-To: <CAPB=Z-oaKQz_bSPag3H+i81cLVahSmvAzmSNYnmfYt_Kn8sGPQ@mail.gmail.com>
On Thu, 2011-12-22 at 15:00 +0200, Raz wrote:
> please correct me if am wrong, " posix semaphores
> are implemented with pi mutex. ..?"
Probably not, that would be pointless. They might be implemented using a
mutex, but I've already looked at glibc this month and my eyes can't
handle more.
> I need a counting semaphore.
> vxWorks priority/fifo semaphores are different from posix semaphores in
> that the behaviour is defined on the semaphore and not the thread.
That doesn't make them sane locking primitives.
> Q: what happens if I want one posix semahore to be FIFO and another
> posix semaphore to be PRIO while both are used by the same
> thread.should i to change policies each time ?
If you need a counting semaphore your program is very likely not a
correct real-time application. So who cares what order things are woken
up in.
Semaphores don't have lock owners, therefore priority inheritance and
related schemes don't work, therefore you suffer from priority inversion
and thus your program is invalid.
Seriously, forget semaphores exist, they're a hysterical accident.
prev parent reply other threads:[~2011-12-22 14:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-20 22:23 Subject: [PATCH 2/2] priority System V Semaphores raz ben yehuda
2011-12-21 18:31 ` Manfred Spraul
2011-12-21 20:48 ` raz ben yehuda
2011-12-22 3:58 ` Steven Rostedt
2011-12-22 8:59 ` Peter Zijlstra
2011-12-22 13:00 ` Raz
2011-12-22 14:00 ` Peter Zijlstra [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1324562457.24803.24.camel@twins \
--to=peterz@infradead.org \
--cc=LBrafman@manz.com \
--cc=RSlutsker@manz.com \
--cc=TScherer@manz.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=raziebe@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).