Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jun 2000 19:55:26 -0700
From:      Jason Evans <jasone@canonware.com>
To:        Luoqi Chen <luoqi@watermarkgroup.com>
Cc:        eischen@vigrid.com, smp@FreeBSD.ORG
Subject:   Re: SMP meeting summary
Message-ID:  <20000626195526.D15267@blitz.canonware.com>
In-Reply-To: <200006270214.e5R2Exu13573@lor.watermarkgroup.com>; from luoqi@watermarkgroup.com on Mon, Jun 26, 2000 at 10:14:59PM -0400
References:  <200006270214.e5R2Exu13573@lor.watermarkgroup.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 26, 2000 at 10:14:59PM -0400, Luoqi Chen wrote:
> > In regards to turnstiles, each kernel thread is born with its own
> > turnstile.  When it blocks on a mutex that doesn't have any waiters
> > (no turnstile allocated to it), it uses the threads turnstile.  If
> > the mutex already has a turnstile (there are other waiters), then
> > the threads turnstile is added to the system (per-CPU?) pool of
> > turnstiles.  When the thread wakes up and acquires the mutex, it
> > takes a turnstile back from the turnstile pool.  Turnstiles are
> > also used for read/write locks.
> > 
> > -- 
> > Dan Eischen
> > 
> Does anyone know why a turnstile structure is used, instead of a sleep
> queue embedded in the mutex structure? With cache line size of 16/32
> bytes, the latter seems to be more advantageous.

There only needs to be one turnstile per entity (process/thread) that can
block.  Putting one in every mutex would actually require much more space.

Jason


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




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