public inbox for
 help / color / mirror / Atom feed
From: Grant Edwards <>
To: Frank Pagliughi <>
Subject: Re: [ECOS] Re: Once again, I need a binary semaphore
Date: Tue, 17 Mar 2015 15:19:00 -0000	[thread overview]
Message-ID: <20150317151943.GA20827@grante> (raw)
In-Reply-To: <>

On Tue, Mar 17, 2015 at 10:57:06AM -0400, Frank Pagliughi wrote:

> I'm in agreement, for what it's worth. I've had to make use of the 
> binary semaphore through the C++ API, and it always made me wonder why 
> it wasn't brought out to the public/C API.

I've been asking that for 15 years.  OK, I exaggerate.  I just looked
itup and the first thread I started on this top was March 2001, so
it's only been 14 years.  The reason given for lack of a binary
semaphore C API was:

   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

Except a counting semaphore initialized to 1 is _not_ functionally
equivalent to a binary semaphore in all cases.  I pointed this out and
provided examples of sequences of wait/post where the behavior
differs, but was told those sequences were "bugs" and (jokingly, I
hope) if I didn't shut up and stop asking questions then the C++
binary semaphores would be removed copletely.

It was quite clear that Nick was adamantly opposed to providing a C
API for binary semaphores and that the needs of eCos users'
application code were to be overruled by his idea of what an comprised
a minimal, complete, elegent set of C APIs: people who want to
write/port C apps that use binary semaphores should just and rewrite
the application code.

IOW, all you really need are two-input NAND gates to model any Turing
complete machine so stop bitching and get to work.


Before posting, please read the FAQ:
and search the list archive:

      reply	other threads:[~2015-03-17 15:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 17:18 [ECOS] " Grant Edwards
2015-03-17  9:21 ` lesc
2015-03-17 14:33   ` [ECOS] " Grant Edwards
2015-03-17 14:47     ` Grant Edwards
2015-03-17 14:57       ` Frank Pagliughi
2015-03-17 15:19         ` Grant Edwards [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150317151943.GA20827@grante \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).