Re: which processor is a thread executing on?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On Oct 1, 2008, at 5:10 PM, Nick Brandaleone <nbrand@mac.com> wrote: I am writing a multi-threaded app, and I would like to know which processor the thread is executing on. Is there a pthread function call to determine this? Dtrace will tell you which processor something is running on at the time you hit a trace point. You can get the same information via XRay instruments, and Shark traces can also be used to get it. A program thread itself can not ask. In part this is because the asking would require a system call, and that would only tell you the CPU that the system call happened on. In part it's because power management takes CPUs offline and online all the time, as needed; this is the same reason we do not permit binding threads to particular CPUs: it would not do you much good to bind a thread to a CPU that was subsequently powered down. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert