Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Sep 2000 11:41:54 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        arch@FreeBSD.ORG
Subject:   Re: Interruptable mutex aquires.
Message-ID:  <20000912114154.H88615@wantadilla.lemis.com>
In-Reply-To: <20000911114746.G12231@fw.wintelcom.net>; from bright@wintelcom.net on Mon, Sep 11, 2000 at 11:47:46AM -0700
References:  <200009111815.MAA21525@berserker.bsdi.com> <20000911114746.G12231@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000912114154.H88615>