[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threads



Pierre Phaneuf wrote:
> 
> Michael Day wrote:
> 
> > > often inefficient when used for this purpose. However one working thread
> > > per processor on an SMP system can certainly be more efficient than a
> > > single thread or process labouring away on only one cpu. This leads to a
> >
> > Following on to my last post, anyone know of any nasty low-level hacks to
> > ensure a particular thread stays on a particular cpu and doesn't hop
> > around, trashing cache all over the place?
> 
> This is called "thread affinity". I do not remember how to use it in
> pthread (or if it is possible with it).

AFAIK linux kernel < 2.2 has no process affinity (and, thereby no
pthread affinity). I do not think even the newer kernels has it.

Mads