Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Nov 2010 08:16:44 +0200
From:      Andriy Gapon <avg@freebsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   smp_rendezvous_cpus() vs sched_bind()
Message-ID:  <4CEB5C4C.90003@freebsd.org>

next in thread | raw e-mail | index | archive | help

If I need to call a function func on a specific CPU which one of the following I
should use?

1.
smp_rendezvous_cpus(1 << cpuid, ..., func, ...);

2.
sched_bind(cpuid);
func();
sched_unbind();

Or does it depend on some additional factors?
What are the main differences here?

And also by extension.
If I need to execute func() on all CPUs - which one is better again -
smp_rendezvous_cpus() or CPU_FOREACH+sched_bind?

Thanks a lot!
-- 
Andriy Gapon



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