From owner-freebsd-arch Mon Sep 11 19:12: 4 2000 Delivered-To: freebsd-arch@freebsd.org Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by hub.freebsd.org (Postfix) with ESMTP id E599137B422 for ; Mon, 11 Sep 2000 19:12:00 -0700 (PDT) Received: (from grog@localhost) by wantadilla.lemis.com (8.11.0/8.9.3) id e8C2Bsq99036; Tue, 12 Sep 2000 11:41:54 +0930 (CST) (envelope-from grog) Date: Tue, 12 Sep 2000 11:41:54 +0930 From: Greg Lehey To: Alfred Perlstein Cc: arch@FreeBSD.ORG Subject: Re: Interruptable mutex aquires. Message-ID: <20000912114154.H88615@wantadilla.lemis.com> References: <200009111815.MAA21525@berserker.bsdi.com> <20000911114746.G12231@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000911114746.G12231@fw.wintelcom.net>; from bright@wintelcom.net on Mon, Sep 11, 2000 at 11:47:46AM -0700 Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Monday, 11 September 2000 at 11:47:46 -0700, Alfred Perlstein wrote: > can you have a look here: > http://people.freebsd.org/~alfred/mpsafe/mpsafestack.diff > > I'm wondering if what I'm doing with socketbuffers is 'right' > basically the socketbuffer is still protected by a sleep+flags > loop, however the flags are actually protected by a mutex > on the socket itself and msleep is called after setting the > flags to request a wakeup with PCATCH set. > > or from my journal at > http://people.freebsd.org/~alfred/mpsafe/stackjournal.txt : > > Initially I wanted to place mutex locks in both the socket and > socketbuffer structures, that proved to be too painful, instead > use a lock on the socket and keep the old sleep/flags locking on > the socketbuffer, there isn't a race because the socketbuffer > flags are protected by my socket lock and the newly added msleep() > function allows me to maninpulate the flags and sleep on them > safely with my socket mutex interlocked. > > It's a bit confusing to me because mutexes can be used for long > term mutual exclusion and one might still want to be able to > grab a signal and return an error if things go to pot. I think we need to come to some kind of consensus about how we are going to structure locking before we go into this much detail. At the moment we don't even agree whether we can hold on to (blocking) mutexes for long periods of time. Greg -- Finger grog@lemis.com for PGP public key See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message