[ECOS] Cyg_Binary_Semaphore class
Richard Wicks
rich@accetnetwork.com
Thu Oct 18 14:39:00 GMT 2001
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
More information about the Ecos-discuss
mailing list