PID Generator

Hi Folks,
Can anyone tell me how windows(OS) generated PID for each process alive. and how does it organise these PIDs.
Can someone give me algorithm or any link to the resouce on this issue.
i shall be very thankful to u
Thanks & Regards
Sanju
[292 byte] By [ursanju] at [2007-11-19 9:00:34]