title: CPU Numbering on a hypertheading enabled system
body: <p>I am trying to find out how an OS (Windows, linux) assigns numbers to logical cpus in a Hyper threading enabled environment. ?</p>
  
  <p>Does both the OSs first serially assign numbers to the Physical CPUs and then start numbering the logical cpus or is there some other rule followed.. ? e.g. in 2 physical cpu system with hyper threading , does an OS assign number 0,2 to the first physical cpu and then 1,3 to second physical cpu .. ? </p>
  
  <p>Any references would be really appreciated. </p>
  
  <p>Thanks in advance.</p>
  
  <p>Regards, -Jay.</p>
  
  <p>Edit: Responding to Alan's question : I need to know this because, In my work I need to bind various threads to specific CPUs to avoid context switches and I want to make sure that certain Tasks( THreads ) are bound to <em>separate</em> physical cpus. Thanks</p>