Date: Sat, 7 Oct 2006 07:38:12 +0800 From: David Xu <davidxu@freebsd.org> To: freebsd-hackers@freebsd.org Cc: Stanislav Sedov <stas@freebsd.org>, Jonathan Chen <jon@freebsd.org> Subject: Re: running code on all CPUs Message-ID: <200610070738.12529.davidxu@freebsd.org> In-Reply-To: <20061006174504.c4af61ba.stas@FreeBSD.org> References: <20061004214040.GA6878@porthos.spock.org> <200610050829.36266.davidxu@freebsd.org> <20061006174504.c4af61ba.stas@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 06 October 2006 21:45, Stanislav Sedov wrote: > > AFAIK, you can use scheduler API, the sched_bind() moves current thread > > to a specific CPU, hope this helps. > > You can find examples e.g. in hwpmc driver. Just grep by sched_bin. > > -- > Stanislav Sedov <stas@FreeBSD.org> [[§²§à§ã§ã§Ú§ñ, §®§à§ã§Ü§Ó§Ñ]] > PGP id: 0xEB269581 http://people.freebsd.org/~stas/stas.key.asc sched_pin is different than sched_bind, sched_pin only pins current thread on current cpu, but sched_bind allows a thread to migrate to another CPU, after the sched_bind returns, the thread should already be running on the specified CPU, it makes it possible that a thread can iterate through all available CPUs. David Xu
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610070738.12529.davidxu>