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]

Re: cyg_cond_signal() without cyg_cond_wait ()


"Trenton D. Adams" <tadams@theone.dnsalias.com> writes:

> Ok, that makes sense.  I thought you might have to use another condition
> variable, but I wasn't sure if that was good practice.

Having several conditions within a single critical region is normal
practice.

> However, it
> WOULD be bad practice to lock the scheduler until I'm done doing
> something with the data!

Exactly.

> 
> My other solution of locking the mutex until the start of the next loop
> would work too though right?

Probably, but it is not something I want to seen to encourage. Mutexes
should be kept locked for the minimum period possible.


-- 
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]