[ECOS] binary vs. counting semaphore and timed wait

David Brennan eCos@brennanhome.com
Sat Jun 7 05:44:00 GMT 2003


On Thu, 2003-06-05 at 02:51, Nick Garnett wrote:
> David Brennan <eCos@brennanhome.cxm> writes:
> 
> > In the process of porting an application to eCos, I came across the use
> > of a binary semaphore with a timed wait function.  The eCos
> > Cyg_Binary_Semaphore interface does not provide this.  But it sure looks
> > like the rest of the code is similar enough to the counting semaphore
> > that it could be implemented very easily.  However before I do this, is
> > there some particular reason this was not implemented?  I'd be very
> > interested to hear if this is a bad idea.
> > 
> 
> Timeouts were added to the counting semaphores because it was needed
> for POSIX compatibility. Nobody needed it in the binary semaphores
> until now.
> 
> If you want to add a timed wait for binary semaphores, go ahead. Make
> sure you ifdef it with CYGFUN_KERNEL_THREADS_TIMER, and follow the
> example of the counting semaphores. In theory it should be a fairly
> simple copy-paste-edit of the counting semaphores code.
> 
> When you have it done, submit a patch on the patches list, with a
> ChangeLog entry, and someone will check it over and commit it to the
> repository.
> 
> 
> -- 
> Nick Garnett                    eCos Kernel Architect
> http://www.ecoscentric.com/     The eCos and RedBoot experts
> 
> 

This is the first time I have ever submitted a patch for anything.  So I
am not sure if I am doing this in the correct format.  Please feel free
to let me know what I am doing wrong as you see necessary.

Thanks
David Brennan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin_sem.tar.gz
Type: application/x-gzip
Size: 3621 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-patches/attachments/20030607/aa76d89e/attachment.bin>


More information about the Ecos-patches mailing list