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]

Re: No binary semaphore in C API?


Jonathan Larmour <jlarmour@redhat.com> writes:

> Grant Edwards wrote:
> > 
> > So, I wanted to use binary semaphores, but can't find the API.
> > The program is using counting semaphores right now, but using a
> > binary ones would be a bit more "defensive".
> > 
> > Is there a technical reason that there isn't a C API for binary
> > semaphores, or is it something that just hasn't been done yet?
> 
> Certainly no technical reason. Nick may not have done it out of principle.
> But right now he's on vacation, so it's best to wait till he returns.
> 

It was never intended that the KAPI be a complete reflection of the
kernel implementation. It is meant to be a consistent, self-contained,
small API that can be used by C applications. Like the uITRON and
POSIX APIs it only exposes a subset. It was considered unnecessary to
export binary semaphores, since a counting semaphore initialized to 1
is functionally equivalent.

If I had had my way the KAPI would have been even more minimal that it
currently is.

-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK


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