Subj : Re: Threads and processes on Linux To : comp.programming.threads,comp.os.linux.misc,comp.sources.d From : steve Date : Sun Apr 03 2005 08:09 am In article <0Au3e.12353$r47.4205@fe3.news.blueyonder.co.uk>, doug wrote: > >"Steve Watt" wrote in message >news:d2l9rq$1go3$1@wattres.Watt.COM... [ big snip ] >> Therefore, I would even more strongly point to the network stack -- >> threads that are waiting on some lock in the stack _will_ be "idle" in >> the OS's view. >> -- > >Ahh - thanks for that, I didn't realise. > >It does indeed point to the network stack, eh? OK, I'll look into that in >closer detail. > >Just out of interest, would you be able to hazard a guess as to why my code >speeds up a lot when all threads are bound to a single CPU (but still not as >good as uniprocessor)? [ educated wild-ass guess follows ] Two possibilities: - You aren't running a (particularly?) preemptable kernel, so no contention will ever happen inside the kernel if the threads are all running on the same CPU. - If you are running a fairly preemptable kernel, the locking routines behave significantly differently when the mutex being contested is held by a thread with affinity for the current CPU. Details left as more wild speculation. At least, that's my story until something better comes along. ;) -- Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" Internet: steve @ Watt.COM Whois: SW32 Free time? There's no such thing. It just comes in varying prices... .