From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Garnett To: "Trenton D. Adams" Cc: Subject: Re: [ECOS] cyg_cond_signal() without cyg_cond_wait () Date: Thu, 30 Aug 2001 09:04:00 -0000 Message-id: References: <000801c1316c$4503caf0$090110ac@TRENT> X-SW-Source: 2001-08/msg00949.html "Trenton D. Adams" 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