Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 7/7/83; site rlgvax.UUCP Path: utzoo!linus!philabs!seismo!rlgvax!tom From: tom@rlgvax.UUCP Newsgroups: net.unix-wizards Subject: Re: sleep() Message-ID: <795@rlgvax.UUCP> Date: Fri, 8-Jul-83 12:28:05 EDT Article-I.D.: rlgvax.795 Posted: Fri Jul 8 12:28:05 1983 Date-Received: Sat, 9-Jul-83 15:47:07 EDT References: <567@hou5d.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 20 The sleep() system call was changed to alarm(), pause() between V6 and PWB UNIX. At that time the whole sleep structure was redone. The new setup had the bug/limitation that there is a critical period between setting the alarm and actually getting to sleep. It also has the unfortunate point of using and relying on signals, which generally suck. However, before you jump to put in the old sleep() system call, you should be aware of its problem, too. The old way that sleep() was done had a very inefficient implementation. If several processes were sleeping, and the time came for one to wake up, they ALL woke up. They would ALL swap in (if they were swapped out), check to see if their time elapsed, and if not, would go back to sleep again. In a system I designed once, I had the machine thrashing like hell because several processes were supposedly sleeping!!! Installing pause() speeded the machine up greatly. So, if you are going to put sleep() back, make sure you do it well... - Tom Beres CCI, Reston (formerly RLG) {sesimo, allegra, mcnc, brl-bmd}!rlgvax!tom