mit krb5 and threads - api

Jeffrey Hutzelman jhutz at cmu.edu
Tue Mar 9 18:16:28 EST 2004



On Tuesday, March 09, 2004 16:28:26 -0500 Jeffrey Altman 
<jaltman at columbia.edu> wrote:

> Ken Raeburn wrote:
>
>>
>>> OpenAFS has run into some problems because developers
>>> make the assumption that mutexes can be safe locked
>>> twice within the same thread.  This has lead to some
>>> interesting deadlock situations which are difficult
>>> to debug.
>>
>>
>> Sounds like another good reason to require simple locks.
>>
>> Ken
>
> It is because the locks are simple that the problems
> have occurred.  A thread locks something and calls into
> a function which then attempts to lock the same thing
> and deadlocks.

Yeah; this is called improper use of an interface.
What locks you must or must not hold when calling a function are part of 
the interface to that function.  It is up to you to use the interface 
correctly, just as it is up to you to not pass in 1000000 as the length of 
a 256-byte buffer.




More information about the krbdev mailing list