Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!cbosgd!gatech!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.unix-wizards Subject: Re: Pids Message-ID: <1219@umcp-cs.UUCP> Date: Sun, 27-Apr-86 14:54:56 EDT Article-I.D.: umcp-cs.1219 Posted: Sun Apr 27 14:54:56 1986 Date-Received: Thu, 1-May-86 02:31:55 EDT References: <266@brl-smoke.ARPA> Reply-To: chris@maryland.UUCP (Chris Torek) Organization: University of Maryland, Dept. of Computer Sci. Lines: 38 In article <266@brl-smoke.ARPA> rbj@icst-cmr.arpa (root) writes: >I just finished reading McKusick's paper on `Measuring & Improving >the Performance of 4.2'. [...] > >1) Pids seem to wrap at 32K. Actually, at 30000. >2) I have only observed this once, as our machine usually finds > an excuse to crash, or we reboot it for somne reason. Even so, it > took more than a week. You just are not doing enough with your machine :-). Ours tend to wrap around every few hours or days. >3) Until the wrap around, *each pid generated (++pid) is guaranteed > to be unique*! >4) My solution is to have a flag (pidwrap) which is set at the obvious time. > If the flag is clear, *why search at all*? If not, do it the hard way. This is not necessary. 4.3 has a `pidchecked' variable that it sets to the top of a free range of pids starting at `mpid'. This means that one search at boot time sets this to 30000, after which there are no scans until the first wrap. It then starts mpid at 100 (not 1, since there are usually all sorts of servers cluttering up the lowest part of the PID space) and does another scan. This usually nets a few hundred free PIDs at the least, and continues working through any number of wraps. It depends on only two things: Process ID space is sparsely populated, and long-lived processes are rare. >5) Any reason not to use unsigned pids, this doubling their range? Fear of breaking old code, perhaps. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu