From owner-freebsd-current Wed May 23 10:21: 5 2001 Delivered-To: freebsd-current@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id E389D37B422 for ; Wed, 23 May 2001 10:21:03 -0700 (PDT) (envelope-from jhb@foo.osd.bsdi.com) Received: from foo.osd.bsdi.com (root@foo.osd.bsdi.com [204.216.28.137]) by pike.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f4NHL2K59995; Wed, 23 May 2001 10:21:02 -0700 (PDT) (envelope-from jhb@foo.osd.bsdi.com) Received: (from jhb@localhost) by foo.osd.bsdi.com (8.11.1/8.11.1) id f4NHL1B44567; Wed, 23 May 2001 10:21:01 -0700 (PDT) (envelope-from jhb) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200105231123.f4NBNUD33639@rina.r.dl.itc.u-tokyo.ac.jp> Date: Wed, 23 May 2001 10:21:01 -0700 (PDT) From: John Baldwin To: Seigo Tanimura Subject: RE: New strategy of locking a process group 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 23-May-01 Seigo Tanimura wrote: > The issue of both of the solutions briefed above is that the p_pgrp > lock protects *excess* data. It might be another solution to introduce > a new mutex (p_pgrpmtx) into struct proc to lock p_pgrp. Although > memory size costs per process, contention for p_pgrp lock should occur > much less than to adopt a session lock or a global lock. > > As psignal() and some other functions also read p_pgrp, p_mtx should > also lock p_pgrp. You lock either p_pgrpmtx or p_mtx to read p_pgrp, > and both of the locks to modify p_pgrp. Sounds good. I would just use a global p_grp lock for now. It can always be changed to be more fine-grained later if desired. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc "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