in reply to atomic operations

You would need a real-time operating system to enforce this kind of restriction. As far as I know there aren't an RTOSes that support Perl. It might be possible to use something like RTLinux which offers an RTOS core and a non-real-time OS running at the same time.

However, I think it's worth pointing out that the situation you describe is exceedingly unlikely to occur. Most operating systems don't start reusing PIDs until they reach their maximum PID, which is generally a long time even for a very fast system.

-sam