On 12-Feb-2003 Maksim Yevmenkin wrote:
> Dear Hackers,
> 
> Does WITNESS keeps track of particular mutex instance or
> just places where particular mutex type was acquired and
> released? Is it even possible to keep track of individual
> instance of the particular mutex type?

It just keeps track of types.  This is sufficient for tracking
lock orders.

> Here is my problem. In my code (Bluetooth sockets layers)
> each socket/PCB has a mutex. The mutex type is the same.
> Also there are few global mutexes that used to protect
> sockets/PCBs list etc. 
> 
> Now when i do testing and both client and server reside
> on the same machine, i, sometimes, get "lock order reversal"
> messages. All messages can be put into two groups:
>:
> 1) Both mutexes are particular instances of the two different
>    types.

This is a bug then.  You shouldn't be doing this unless you
have a well defined order for when you acquire different
instances of the lock.  Otherwise, what is to prevent two
threads from acquiring the same two locks of the same type
in the opposite order?

> 2) One mutex is global and another is particular instance
>    of the particular type.

Similarly, you need to have the same order between global
mutexes and all the mutexes of a given type.

> These messages are bugging me and i want to get to the 
> bottom of this. How i can verify/convince myself that
> these messages are not problems? How should i deal with
> multiple mutex instances? Will WITNESS be able to help
> me here?
> 
> thanks,
> max
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-current" in the body of the message

-- 

John Baldwin <[EMAIL PROTECTED]>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to