From owner-freebsd-smp Thu Apr 25 1:10:13 2002 Delivered-To: freebsd-smp@freebsd.org Received: from rina.r.dl.itc.u-tokyo.ac.jp (rina.r.dl.itc.u-tokyo.ac.jp [133.11.199.247]) by hub.freebsd.org (Postfix) with ESMTP id 6F2C337B41B; Thu, 25 Apr 2002 01:10:07 -0700 (PDT) Received: from rina.r.dl.itc.u-tokyo.ac.jp (localhost [127.0.0.1]) by rina.r.dl.itc.u-tokyo.ac.jp (8.12.2/3.7W-rina.r-Nankai-Koya) with ESMTP id g3P8A50o010159 ; Thu, 25 Apr 2002 17:10:05 +0900 (JST) Message-Id: <200204250810.g3P8A50o010159@rina.r.dl.itc.u-tokyo.ac.jp> Date: Thu, 25 Apr 2002 17:10:04 +0900 From: Seigo Tanimura To: Bosko Milekic Cc: Seigo Tanimura , current@FreeBSD.ORG, smp@FreeBSD.ORG Subject: Re: Locking down a socket, milestone 1 In-Reply-To: <20020424085741.A62067@unixdaemons.com> References: <200204241110.g3OB8u8t006194@bunko> User-Agent: Wanderlust/2.8.1 (Something) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-1?Q?Unebigory=F2mae?=) APEL/10.3 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Digital Library Research Division, Information Techinology Centre, The University of Tokyo MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, 24 Apr 2002 08:57:41 -0400, Bosko Milekic said: bmilekic> I've literally just had time to glance at this so far, but can you, if bmilekic> you don't mind, please just briefly explain what BSD/OS does with bmilekic> sockbuf locking (do they use the same lock, or...?) In BSD/OS, each of the sockbufs in a socket has a mutex. It protects the data in the sockbuf. In addition, the mutex of the receive sockbuf also protects the whole data of the socket as well. BSD/OS seems to have no global locks to protect the relation between sockets. One thing I am not sure is the lock requirement upon waking up a process tsleeping for socket operation. In BSD/OS, some parts wake up processes with a socket locked, while the other parts not. I am going to make all of the functions calling sowakeup() to lock a socket first. -- Seigo Tanimura To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message