Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.unix-wizards Subject: Re: Pids Message-ID: <6669@utzoo.UUCP> Date: Thu, 8-May-86 15:54:35 EDT Article-I.D.: utzoo.6669 Posted: Thu May 8 15:54:35 1986 Date-Received: Thu, 8-May-86 15:54:35 EDT References: <266@brl-smoke.ARPA> Organization: U of Toronto Zoology Lines: 12 Several solutions to the inefficient pid-duplication-search problem exist. A few of them were described in the Usenix newsletter a while ago. The simplest approach is the one Chris Torek has mentioned: it is trivial to change the search loop so that instead of looking for an exact match, it looks for the lowest pid >= than the one you're trying. Then if you don't get an exact hit (the = part of >=), you've got a range of pids which are known to be unused, and the search needs to be repeated only when that range is exhausted. This idea has been independently re-invented several times in different places. -- Join STRAW: the Society To Henry Spencer @ U of Toronto Zoology Revile Ada Wholeheartedly {allegra,ihnp4,decvax,pyramid}!utzoo!henry