[En-Nut-Discussion] Feature Request 1572837: mutex API nesting level info

Bernard Fouché bernard.fouche at kuantic.com
Fri Jul 18 18:17:54 CEST 2008


Nathan FakeLastName wrote:
>
> The whole idea is that within any function a programmer only needs to worry
> about if she
> has matched up the local locks and unlocks and never ever have to think
> about what
> called functions might lock and unlock, and just assume that those functions
> have also
> matched up the locking and unlocking of all recursive mutexes that it might
> have used.
>
>   
eCos explanation is related to design guidelines and not complexity, 
memory footprint or lack of understanding of recursive mutexes.

Sure, when you write alone 100% of the application code and stay as the 
only maintainer and you write extensive documentation in the code you 
may use recursive mutexes and have not much problem, however if your 
work is shared or if someone (even yourself!) comes some time later to 
perform changes on the code, then recursive mutexes may appear as black 
magic.

An excellent explanation about why to avoid recursive mutexes by someone 
that knows what he writes about:

http://www.zaval.org/resources/library/butenhof1.html




More information about the En-Nut-Discussion mailing list