Pumpkin, Inc.

Pumpkin User Forums

Documentation question on Event Flags

If you have a general question or comment regarding Salvo, post it here.

Documentation question on Event Flags

Postby jeffc » Fri Oct 28, 2005 6:45 am

I was reading the Salvo manual, v3.2.2, and have the following question about event flags:

In the notes for OSSetEFlag() (p.344), it states that all tasks waiting an event flag are made eligible by forcing any zeroed bits to one.

However, in the FAQ (p. 235) 'when an event occurs and there are tasks waiting for it, which task(s) become eligible?', it states that only a single task will become eligible.

Which statement is correct?

It sounds like the FAQ is only talking about semaphores and not event flags. Is that the case?

thanks,
Jeff

jeffc
 
Posts: 8
Joined: Thu Oct 27, 2005 11:00 pm

Re: Documentation question on Event Flags

Postby aek » Fri Oct 28, 2005 7:52 am

Hi Jeff.

Event flag processing is a "special case" and is a bit different from all the other event types.

Specifically, if, say, a binSem is signaled, since the binSem's event queue is a priority queue and only a single task can be at the head of a queue (even if multiple tasks are waiting the binSem), then just that one task is made eligible when the binSem is signaled.

eFlags are different because of the fact that multiple tasks can wait on individual bits of an eFlag -- i.e. there is no real sense of priority associated with tasks waiting an eFlag, because a change in any bit must be seen by every task that's watching that bit. Therefore, Salvo has to make all tasks that wait an eFlag eligible whenever the eFlag is signaled. The now-eligible tasks all retain their priorities, of course, with regard to when they'll actually run.

So, yes, the FAQ is talking about all event types except eFlags. eFlags behave slightly differently, and one sees this when more than one task waits a particular eFlag.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Documentation question on Event Flags

Postby jeffc » Fri Oct 28, 2005 7:58 am

Thanks for the clarification.

I'd like to suggest that the FAQ in the manual be updated to include your answer.

thanks,
Jeff

jeffc
 
Posts: 8
Joined: Thu Oct 27, 2005 11:00 pm

Re: Documentation question on Event Flags

Postby aek » Fri Oct 28, 2005 9:00 am

Done -- added to the FAQ. Will be released with the next release of the manual.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron