56d Subj : Re: Binding a thread to particular processor Linux To : comp.programming.threads From : Ben Hutchings Date : Thu Mar 24 2005 02:02 am doug wrote: > To answer my own question, sched_setaffinity allows you to set processor > affinity. I've managed to find object code on a 2.4 system with this > function, and it seems to work. My manual page says "The affinity syscalls were introduced in Linux kernel 2.5.8." Maybe your vendor backported them to 2.4, but you had better not rely on them being present in other distributions with 2.4 kernels. > It also seems to provide thread affinity - at least the benchmark results > change as I assign different threads to different processors, so i seems to > be affecting per-thread, rather than just per process. Does this surprise > anyone? Not really, since the threads are actually implemented as separate processes in the 2.4 kernel. > Now I'm stuck on setting interrupt affinity. Anyone know how to do this? > Or does sched_setaffinity do this for me? Surely interrupts aren't associated with any process, so this wouldn't have any effect on them. Do you mean signals? Signals run within an existing thread so they should, I think, be subject to the affinity of that thread. -- Ben Hutchings In a hierarchy, every employee tends to rise to his level of incompetence. . 0