The Active Network
ActiveMac Anonymous | Create a User | Reviews | News | Forums | Advertise  
 

  *  

  Why are process and thread IDs multiples of four?
Time: 07:17 EST/12:17 GMT | News Source: Microsoft | Posted By: Kenneth van Surksum

Raymond Chen: On Windows NT-based operating systems, process and thread IDs happen always to be a multiple of four. Is this just a coincidence?

Yes, it's just a coincidence, and you shouldn't rely on it since it is not part of the programming contract. For example, Windows 95 process and thread IDs were not always multiples of four. (By comparison, the reason that kernel handles are always a multiple of four is part of the specification and will be guaranteed for the foreseeable future.)

Process and thread IDs are multiples of four as a side-effect of code re-use. The same code the allocates kernel handles is also used to allocate process and thread IDs. Since kernel handles are a multiple of four, so too are process and thread IDs. This is an implementation detail, so don't write code that relies on it. I'm just telling you to satify your curiosity.

Write Comment
Return to News

  Displaying 426 through 426 of 426
Prev | First
  The time now is 2:33:40 PM ET.
Any comment problems? E-mail us
#426 By 4240821 (142.111.253.203) at 2/14/2025 12:01:30 AM
https://hotpic.cc/album/y8d9J5GTBGwCt
https://hotpic.cc/album/TYK70wgVXMA3a
https://hotpic.cc/album/oYlaknpcU2S68
https://hotpic.cc/album/cFAv4kTzc5hD7
https://hotpic.cc/album/FOyHmQ8cyGjOT
https://hotpic.cc/album/vwHU1UuBI4VrI
https://hotpic.cc/album/vatMwbe95pRHg
https://hotpic.cc/album/t7y5AYGsGU8v3
https://hotpic.cc/album/fpXrqilASedoH
https://hotpic.cc/album/Nj1aUshFBNTv2

Write Comment
Return to News
  Displaying 426 through 426 of 426
Prev | First
  The time now is 2:33:40 PM ET.
Any comment problems? E-mail us
User name and password:

 

  *  
  *   *