This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ECOS] binary vs. counting semaphore and timed wait


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

Attachment: bin_sem.tar.gz
Description: GNU Zip compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]