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: from ISR to thread


Robin Farine <acnrf@dial.eunet.ch> writes:

> Hi,
> 
> I do not understand, why don't you use a counting semaphore instead of the
> condition variable? What makes you think that a DSR can signal a condition
> variable but not a counting semaphore?
> 

While there is no technical reason for not using a counting semaphore
in a DSR, there is no support for counting semaphores in the driver
API. The main reason for this is that properly written device drivers
should be able to work even when the eCos kernel is absent. To support
this there is a non-kernel implementation of the API in
hal/common/current/src/drv_api.c. It's a lot easier to implement
mutexes and condition variables in such an environment that more
complex synchronization mechanisms. Mutexes and condition variables
are also the best minimal synchronization primitives, since the effect
of any other primitive can be duplicated with them.

Of course if your driver is never going to be used in a non-kernel
situation, you can do whatever you want, it just won't be as portable.

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


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