tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* How are pids allocated under Digital Unix?
@ 1995-04-01 10:09 Cameron Strom
  0 siblings, 0 replies; only message in thread
From: Cameron Strom @ 1995-04-01 10:09 UTC (permalink / raw)
  To: tru64-unix-managers


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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-04-01 10:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-04-01 10:09 How are pids allocated under Digital Unix? Cameron Strom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox