9 Jun
2004
9 Jun
'04
15:53
On Wed, Jun 09, 2004 at 05:41:31PM +0200, Philip J. Mucci wrote:
Hi folks,
I'm trying to use sched_setaffinity to force threads onto certain CPU's. However the header file indicates it takes a pid_t. Now, this would be fine with LinuxThreads, but 2.6 uses NPTL and thus the pid is the same for all threads in the process. The page says I can specify '0' to mean the current process, but I'm not sure if it's doing the right thing under the covers. I figured I would post here before posting to the LKML.
Any ideas how to force NPTL threads to certain CPU's through the API?
The threads have actually different pids, just ps only shows a single pid. Just execute getpid() in the thread and use what it returns. -Andi