Re: SMP and Multithreaded Applications under linux
- From: "Gene" <e_berta@xxxxxxxxxxxxx>
- Date: 22 Jan 2006 18:01:16 -0800
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
.
- References:
- SMP and Multithreaded Applications under linux
- From: durrik
- SMP and Multithreaded Applications under linux
- Prev by Date: Re: fork question
- Next by Date: Re: POSIX Timers on Linux 2.4
- Previous by thread: Re: SMP and Multithreaded Applications under linux
- Next by thread: Is there such a thing as an invalid thread id?
- Index(es):
Relevant Pages
|