[ECOS] reentrant mutex

Jonathan Larmour jifl@eCosCentric.com
Mon Apr 14 12:11:00 GMT 2003

Nick Garnett wrote:
> Jonathan Larmour <jifl@eCosCentric.com> writes:
>>Whether or not "strategically" such a patch would be accepted in the
>>sources I'll leave to Nick G though. Personally I'm keen as the kernel
>>is meant to be more than just basic primitives, but a box of tools to
>>make development easier.
> I would personally not like to see such a patch. It would not work
> very well with condition variables and any system that mixed regular
> and recursive mutexes would be very hard to debug. 

I'm not sure it would make that much difference since they would be 
completely different types... I would agree that making a Cyg_Mutex have 
configurable behaviour would be bad and confusing. Similarly therefore, 
since condvars only take a Cyg_Mutex and not a Cyg_Recursive_Mutex (or 
whatever), it should be fine.

> In my opinion, a need for recursive mutexes is usually a symptom of
> poor program design. 

I'm not sure it's up to us to decide. And getting people to write more 
code each time means more scope for errors on their part, whereas we can 
be sure to have one that is well tested.

> If anybody really wants recursive mutexes, then they can always
> implement them above the existing mutex mechanism. For example:

We could say that about much of the kernel :-).

Anyway, I just want to be sure that defining a recursive mutex as a 
completely different type would still not be acceptable.

eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine

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

More information about the Ecos-discuss mailing list