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

Re: Threads



> > AFAIK linux kernel < 2.2 has no process affinity (and, thereby no
> > pthread affinity). I do not think even the newer kernels has it.
> 
> Pity, this could be a useful feature to watch out for in forthcoming
> kernels, perhaps. At least in linux we can (theoretically) jump in and
> code it ourselves :) Maybe could post off some questions to a kernel
> hacker somewhere and see if some root level affinity functions would screw
> things up or not, presumably you wouldn't want just any process being able
> to choose what the cpus should do... although a simple "hinting" mechanism
> could work, two threads ask to run on different cpus, and if the system
> *has* two cpus and it is feeling generous, it will allow this :)

	 If the threads are large enough, shouldn't the kernel be smart enough
to know that they should be run on seperate processors? Or does the kernel
only hand over work to the 2nd cpu when the 1st one is too busy? And what
advantage is there to process affinity? (Would telling a thread to run on
processor number 3 screw things up on a 2 processor system? Or will the kernel
correct your mistake?)
								--Brad
(In case you hadn't already guessed, I'm no kernel hacker ;)