This is the mail archive of the ecos-discuss@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: counting semaphore-ecos.


"Vivek.K.M" <vivekkm@sasken.com> writes:

> Hi Nick,
>    
>   I was going through the ecos kernel reference manual. The creation
>   of the counting semaphore in ecos does not support taking the
>   maximum count. Could you provide me the rationale behind this decision.
> 
>   The only reasoning I could think of is that it could mask some
>   bugs in the user program.i.e. ecos does not increment the count
>   if it has already hit the maximum count. Even in this case, an
>   assert at this point could help localizing the problem.
> 
>   BTW, I searched the ecos mailing list for an answer to this question.
>   Could not find one..
> 
> Thanks for any response.
> best regards,
> vivek.
>  

You should really send questions like this to the ecos-discuss list,
individual engineers may not always be available to answer.


To answer your question: I did consider it but decided that the extra
word per semaphore that this required, and the extra code to manage
and test it, was not ultimately worthwhile. It was also intended that
we eventually support POSIX - most of the synchronization primitive
APIs are modelled on POSIX -  and that does not specify a maximum
count. If a user is particularly worried about the semaphore exceeding
some maximum they can always add assertions in their own code using
cyg_semaphore_peek().

-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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