This is the mail archive of the ecos-patches@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: [ECOS] binary vs. counting semaphore and timed wait


David Brennan <eCos@brennanhome.com> writes:

[It's best to keep these discussions on the list.]

> Anyways, I was curious about the note in the Changelog about
> implementing this differently than the counting semaphores.  I think
> they should match, but my implementation of using the binary semaphore
> timed wait will require it to work as I programmed it.  Is it a posix
> requirement that if you do a timed wait, and the timer expired before
> you can check the semaphore, that you must report it as not posted?  If
> not, I would like to submit changes to the other semaphores to work like
> I implemented the binary semaphore. (Maybe with a backward compatability
> flag in CDL?)

I think the code works the way it currently does just because that was
the way it was written. The issue we are talking about is a pretty
obscure corner case. It's unlikely to happen very often and is
really the result of a race condition in the application and could
easily come out either way.

The exact semantics probably don't matter too much. So changing the
way this works would have little impact, and would not need any kind
of backward compatability feature.

sem_timedwait() is a POSIX-2001 feature that has not yet been added to
the eCos POSIX library. Reading the description, it does seem that the
semantics you suggest are probably the preferred ones -- but it is not
at all clear. 

> 
> Also, was the CDL file the correct place to add the additional test to
> get it generated in the Makefile?
>

Yep, that's exactly what to do.


We'll have to wait for you binsem patch to clear assignment, but I
might change the counting semaphores myself -- if I can work up the
enthusiasm :-)

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


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