This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cyg_semaphore_post


On Mon, Feb 11, 2002 at 12:58:04PM +0100, Stijn Symons wrote:
> Will the cyg_semaphore_post function still increment the count if there
> are threads waiting on it, or does it only wake up a thread?
> And witch thread does it wake up, the one with the highest priority or
> just random?

The documentation says:

"If there are threads waiting on this semaphore this will make exactly
one of then. Otherwise it simply increments the semaphore count".

So that answers 1/2 of your question. 

Reading the code, it looks like post takes from the head of the
queue. It does not look like the queue is prioritized.

Thinking about it, i'm not sure priorities make sense. Could you
explain what you mean and how you would use them.

       Andrew

Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]