Re: SMP and Multithreaded Applications under linux



If you are using kernel 2.5.8+ you can also play around with setting
the affinity of the threads to certain CPU's. Translation-- you can
manually spread the threads around yourself. This can be very powerful
and useful for increasing CPU cache hit rates by forcing certain
threads to always use the same CPU. You use getpid() to find the
process ID of the thread and then use sch_setaffinity() to tell the
kernel to try to make this thread always run on a certain CPU.

Gene
e_berta@xxxxxxxxxxxxx

.



Relevant Pages