From owner-freebsd-net@FreeBSD.ORG Sun Jun 29 17:56:41 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D9A637B401 for ; Sun, 29 Jun 2003 17:56:41 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id C26424400B for ; Sun, 29 Jun 2003 17:56:40 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9/8.12.9) with ESMTP id h5U0u6KJ095712; Sun, 29 Jun 2003 20:56:06 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h5U0u6Gg095709; Sun, 29 Jun 2003 20:56:06 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Sun, 29 Jun 2003 20:56:06 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: "George V. Neville-Neil" In-Reply-To: <87y8zkwj6k.wl@jchurch.neville-neil.com.neville-neil.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: Another question on locking... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2003 00:56:41 -0000 The locking in the -CURRENT tree for the socket stack is currently incomplete; something we hope greatly to remedy on the way to 5.2-RELEASE. So currently all this code runs under the Giant lock, which is why it's safe. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories On Sun, 29 Jun 2003, George V. Neville-Neil wrote: > Hi, > > Looking at the code in uipc_socket.c and udp_usrreq.c I am a > bit confused as to how the locking mechanism works between the > sockets and the protocols. The socket calls all occur under > Giant, which the protocols do not deal with, and the protocols > all lock on the inp mutex, which the socket calls do not deal > with. Furthermore the sblock/sbunlock calls are only use by > the socket layer. I'm reading udp_input() as it's simpler to > follow. Have I missed something? What prevents a protocol > from writing to a socket buffer at the wrong time or the > socket code from tweaking it at the wrong time? Is this > handled simply because of the priority of the threads doing > the work? > > Thanks, > George > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >