From: Cameron Strom <syscrs () devetir ! qld ! gov ! au>
To: tru64-unix-managers
Subject: How are pids allocated under Digital Unix?
Date: Sat, 01 Apr 1995 10:09:04 +0000 [thread overview]
Message-ID: <96075318306728.tru64-unix-managers.marc@archive.invalid> (raw)
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.
reply other threads:[~1995-04-01 10:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox