This is the mail archive of the ecos-discuss@sourceware.org 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: correct handling of condition variables from DSRs


"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


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