From owner-freebsd-current Fri Feb 21 17:29:48 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0115137B42F for ; Fri, 21 Feb 2003 17:29:46 -0800 (PST) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5188843FE5 for ; Fri, 21 Feb 2003 17:29:44 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 19806 invoked from network); 22 Feb 2003 01:29:53 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 22 Feb 2003 01:29:53 -0000 Received: from laptop.baldwin.cx (laptop.baldwin.cx [192.168.0.4]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id h1M1TAhT005693; Fri, 21 Feb 2003 20:29:10 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3E49A429.DBFA4FBB@cw.com> Date: Fri, 21 Feb 2003 20:29:54 -0500 (EST) From: John Baldwin To: Maksim Yevmenkin Subject: RE: WITNESS questions Cc: current@freebsd.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message