This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: reentrant mutex
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: Nick Garnett <nickg at ecoscentric dot com>
- Cc: mark_lee_hamilton at att dot net, ecos <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 14 Apr 2003 13:11:00 +0100
- Subject: Re: [ECOS] reentrant mutex
- References: <20030411230531.DB402383F7@jifvik.dyndns.org> <3E977529.3000804@eCosCentric.com> <m3k7dxbe76.fsf@miso.calivar.com>
Nick Garnett wrote:
Jonathan Larmour <jifl at eCosCentric dot 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.
Jifl
--
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