[ECOS] Re: correct handling of condition variables from DSRs

Sergei Organov osv@javad.com
Tue May 23 04:49:00 GMT 2006


"Neundorf, Alexander" <Alexander.Neundorf@jenoptik.com> writes:

> Hi,
>
> the eCos docs say that condition variables can be signalled also from
> DSRs. Usually, in order to signal a change, the following code is
> required:
>

[...]

> But since now all three participants (sender from DSR, sender from
> thread, receiver) are all synchronized using cyg_scheduler_lock(), do
> I actually still need the mutex at all ? Or can I simply ignore it ?

No, you can't ignore the mutex as cyg_cond_wait() will unlock the mutex
before going to sleep and lock it back after wakeup. This is pure
overhead in the case of DSR-to-thread synchronization. Special
simplified version of condition variable that will expect scheduler
instead of mutex to be locked at wait() could be implemented in eCos to
get rid of this overhead, though I've already suggested to do it and
didn't receive much interest.

-- 
Sergei.


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



More information about the Ecos-discuss mailing list