On Fri, 01 Jul 2011 14:01:28 EDT erik quanstrom <quans...@quanstro.net>  wrote:
> > 
> > interprocessor interrupts are the obvious solution
> > but no one has bothered to implement them.
> > 
> 
> i almost mentioned this, and it's on my list.  i just haven't
> had the time.  it turns out that a naive implementation of
> ipi'ing 1 proc per wakeup will have to watch out for the
> same races that bedeviled multiprocessor sleep/wakeup.
> 
> the really naive solution of waking 'em all up is a very
> bad idea because you'll have n-1 procs duking it out
> over the run queue.
> 
> perhaps i just ignorant of the standard solution.
> or perhaps the sleep/wakeup model isn't the right one
> for the situation.

You might want to look at how FreeBSD does.  
    http://fxr.watson.org/fxr/source/i386/i386/mp_machdep.c
    http://fxr.watson.org/fxr/source/i386/i386/machdep.c
Robert Watson's excellent site has cross-referenced sources
for a variety of OSes (including plan9) and releases for some
of them.

FreeBSD put in hlt for MP kernels in 2003 but the code has
evolved since then. The commit logs may be of some use too.
See the same files in http://www.freebsd.org/cgi/cvsweb.cgi

Reply via email to