From: "Manfred Spraul" <manfred@colorfullife.com>
To: "Stelian Pop" <stelian.pop@fr.alcove.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: Use semaphore for producer/consumer case...
Date: Mon, 26 Mar 2001 19:12:55 +0200 [thread overview]
Message-ID: <007d01c0b618$040b1780$5517fea9@local> (raw)
In-Reply-To: <000d01c0b3c7$e232ae90$5517fea9@local> <20010326165425.G15689@come.alcove-fr>
From: "Stelian Pop" <stelian.pop@fr.alcove.com>
> >
> > That doesn't work, at least the i386 semaphore implementation
doesn't
> > support semaphore counts < 0.
>
> Does that mean that kernel semaphore can not be used for something
> else than mutual exclusion ?
>
It's a bit better: counts >= 0 are supported, i.e. you can call up()
before down(), and that's used in several places.
The for loop that Nigel proposed should solve your problem. Multiple
up's are handled correctly.
--
Manfred
next prev parent reply other threads:[~2001-03-26 17:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-23 18:34 Use semaphore for producer/consumer case Manfred Spraul
2001-03-26 14:54 ` Stelian Pop
2001-03-26 17:12 ` Manfred Spraul [this message]
2001-03-27 7:57 ` Stelian Pop
-- strict thread matches above, loose matches on Subject: below --
2001-03-23 12:07 Stelian Pop
2001-03-23 23:52 ` Nigel Gamble
2001-03-26 14:52 ` Stelian Pop
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='007d01c0b618$040b1780$5517fea9@local' \
--to=manfred@colorfullife.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stelian.pop@fr.alcove.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