The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 03-06-2007
Perderabo's Avatar
Perderabo Perderabo is offline
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,712
If a process is waiting for a resource it will almost always be asleep and will be woken by the kernel when the resource is available. CPU's do not simply run processes...it might be running kernel code to make those needed resources available. An idle CPU is looping repeatedly scanning the run queue looking for something to do... no other state is counted as idle.

The exception to sleeping for a resource is spinlocking...just looping until the resource is free (because the resource is expected to be locked very briefly). This happens in the kernel in an SMP environment. 16 cpus is a lot and you probably spend a fair amount of time spinlocked. Spinlocking if why you can't have unlimited numbers of cpu's on an SMP box...you reach a point where you spinlock too much.
Reply With Quote