This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Cyg_Binary_Semaphore class
On Thursday 18 October 2001 02:23 pm, you wrote:
> On Thu, Oct 18, 2001 at 10:53:43AM -0700, Richard Wicks wrote:
> > I was poking through the code and I ran across binary semaphores here:
> >
> > ${ECOS_REPOSITORY}/kernel/current/src/sync/bin_sem.cxx
> >
> > I didn't realize these were implemented in the system. I didn't see them
> > covered in the ecos reference manual here:
> >
> > http://sources.redhat.com/ecos/docs-latest/pdf/ecos-ref.pdf
> >
> > Are binary semaphores new? How do I access them from C code instead of
> > C++?
>
> I believe that they've always been there, but you're not
> supposed to use them. You're supposed to use counting
> semaphores instead. There was an extensive philosophical
> discussion about this a few months back.
>
> http://sources.redhat.com/ml/ecos-discuss/2001-03/msg00250.html
Ah, I see.
Well, for the record (not that it matters) I'm on the side of including
binary semaphores for the reason of portability. Lots of operating systems
provide binary semaphores, but not a lot provide events (under eCos I think
the equivalent would be alarms). I need portability because I never program
directly for the OS anymore, everything is done through wrappers implemented
as functions or macros in case the OS vendor tries to screw us (outrageous
royalties, change in license, etc.) or the OS turns out 3 months down the
road not to make the final cut (doesn't actually work as documented, has
interrupt latency 10x what they advertised, company went bankrupt, etc.).
Alarms will do though.
-Rich