wakeup idea...

John-Mark Gurney gurney_j at resnet.uoregon.edu
Sun Mar 5 03:28:49 PST 2006


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."


More information about the freebsd-arch mailing list