From: Tim Wescott on
On 05/29/2010 11:23 AM, Randy Yates wrote:
> Tim Wescott<tim(a)seemywebsite.now> writes:
>
>> On 05/28/2010 03:37 PM, Randy Yates wrote:
>>> Thanks to everyone for your responses, but judging by the complexity
>>> of your responses, I think you misunderstood my question.
>>>
>>> The main point is this: isn't there a "type" of semaphore usually
>>> provided in other OSes which allows multiple tasks to pend on a
>>> "single" post?
>>
>> Yes. It's called a 'binary semaphore'. Sometimes it's called an
>> event' or a 'flag'. A complete RTOS should have both: many have just
>> one or the other, along with some weasle-word justification for the
>> practice that boils down to "we never need to use the other kind of
>> semaphore and we're lazy, so you don't need to use it either".
>
> Ha! I hear ya' Tim.
>
> Well, it turns out DSP/BIOS _does_ have a "binary semaphore." The
> problem is, it's not the type of binary semaphore I need.
>
> From the DSP/BIOS API Reference Manual for SEM_pendBinary():
>
> SEM_pendBinary and SEM_postBinary are for use with binary
> semaphores. These are semaphores that can have only two states:
> available and unavailable. They can be used to share a single resource
> between tasks. They can also be used for a basic signaling mechanism,
> where the semaphore can be posted multiple times and a subsequent call
> to SEM_pendBinary clears the count and returns. Binary semaphores do
> not keep track of the count; they simply track whether the semaphore
> has been posted or not.
>
> [...]
>
> If the semaphore count is non-zero (available), SEM_pendBinary sets
> the count to zero (unavailable) and returns TRUE.
>
> If the semaphore count is zero (unavailable), SEM_pendBinary suspends
> execution of this task until SEM_post is called or the timeout
> expires.
>
> So what I need is not something that can handle multiple posts and one
> pend, but rather something that can handle multiple pends and one post!

MT! (that's the spelling) from US Software used to do that -- their
binary semaphore (they called it an "event") had a 'regular' pend, and a
'check', where you could pend but not clear.

I think it's Nucleus now, but I disremember.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
From: Not Really Me on
Randy Yates wrote:
> Thanks to everyone for your responses, but judging by the complexity
> of your responses, I think you misunderstood my question.
>
> The main point is this: isn't there a "type" of semaphore usually
> provided in other OSes which allows multiple tasks to pend on a
> "single" post?
>
> --Randy

Wow, this may be stating the obvious, but there sure don't seem to be many
DSP/BIOS users on here.

--
Scott
Validated Software
Lafayette, CO



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5169 (20100603) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com