LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   userland: how to find the cpu currently running at (https://www.linuxquestions.org/questions/linux-newbie-8/userland-how-to-find-the-cpu-currently-running-at-703797/)

aasa0001 02-11-2009 02:22 AM

userland: how to find the cpu currently running at
 
Hi everyone,

In a userland program (C), how to get the current cpu? e.g. Is there any API for it?
I do not want to use CPUID:1.

Excuse me if I didn't express it clear, as I am not native English speaker.

syg00 02-11-2009 04:14 AM

Perhaps you might like to look at containers. You can define a control group to only contain the CPUs you wish to be scheduled on (i.e avoid dispatch on any other(s)).
Not really what you asked, but it works fine.


All times are GMT -5. The time now is 06:20 AM.