From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96075318306728.tru64-unix-managers.marc@archive.invalid> From: Cameron Strom Date: Sat, 01 Apr 1995 10:09:04 +0000 To: tru64-unix-managers Subject: How are pids allocated under Digital Unix? X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96075318306728 Hi there. My understanding had been that pids are allocated in a monotonically increasing fashion skipping any that are used, and restarting from a low number at some point. My observations on our dual processor 2100 running Digital Unix v3.0 are as follows: $ sleep 10 & sleep 10 & sleep 10 & sleep 10 & 8206 5235 8282 6860 $ Is it the case that Digital Unix randomly assigns pids? If so, how can we guarantee that the following code snippet will work as expected? PID_LIST=...find a list of processes to kill... kill -15 "$PID_LIST" > /dev/null 2>&1 sleep 2 kill -9 "$PID_LIST" > /dev/null 2>&1 If pids are allocated randomly, and the "kill -15" causes some processes to exit, how can I be sure that pid is not re-used by a process which starts during the 2 second sleep? Should I re-created PID_LIST before each kill? Any insights would be appreciated. Cheers. -- - Cameron Strom syscrs@devetir.qld.gov.au Brisbane, Queensland, Australia.