This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: No binary semaphore in C API?
- To: ecos-discuss at sourceware dot cygnus dot com
- Subject: Re: [ECOS] No binary semaphore in C API?
- From: Nick Garnett <nickg at cygnus dot co dot uk>
- Date: 26 Mar 2001 12:39:07 +0100
- Newsgroups: cygnus.sourceware.ecos.d
- Organization: Red Hat UK
- References: <20010316140116.A1062@visi.com> <3AB67D44.AFB5E10D@redhat.com>
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