Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Mar 2006 03:28:46 -0800
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        arch@freebsd.org
Subject:   Re: wakeup idea...
Message-ID:  <20060305112846.GZ840@funkthat.com>
In-Reply-To: <35339.1141557488@critter.freebsd.dk>
References:  <35339.1141557488@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote this message on Sun, Mar 05, 2006 at 11:18 +0000:
> Here is a possibly stupid idea.
> 
> Historically sleep/wakeup have happened on a pointer which was just
> a magic number.
> 
> In many cases, this pointer is actually a relevant datastructure.
> 
> Would it possibly be an optimization to make a variant of the
> sleep/wakeup calls where the pointer points to an integer type which
> contains non-zero if anybody is actually sleeping on that address ?
> 
> Anybody up for a quick prototype ?

A different idea that I had was for a process to cache the wakeup
address, and then only perform the wakeup when the appropriate lock was
unlocked..  Thus saving the time of waking up a process just for it to
go back to sleep waiting for your lock..  (though this can cause wierd
things to happen wrt priority, i.e. you don't get the to be woken up
process's priority lent to you, if needed)...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



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