Path: utzoo!attcan!uunet!lll-winken!ames!ncar!gatech!rutgers!att!westmark!dave From: dave@westmark.UUCP (Dave Levenson) Newsgroups: comp.lang.c Subject: Re: INKEY$ [Was: printf, data presentation] Message-ID: <856@westmark.UUCP> Date: 15 Jan 89 00:14:13 GMT References: <19@xenlink.UUCP> <225800106@uxe.cso.uiuc.edu> <686@vector.UUCP> Organization: Westmark, Inc., Warren, NJ, USA Lines: 33 In article <686@vector.UUCP>, chip@vector.UUCP (Chip Rosenthal) writes: > In article <225800106@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes: > >>From my recollection of BASIC, INKEY$ has two main uses: ... > >The important point is that some such function should be a > >STANDARD C (ANSI C) function ... > No, that isn't the important point. Such a procedure is generally used > for busy loops, and this is a bad idea... > ...If you are waiting for a one of a number of > assynchronous events, then fork processes to block on the various events > and signal the parent to handle it. ... > Since busy waiting is a bad idea, so is formalizing it in a standard. Waiting for events (such as keystrokes) is not, in itself, a bad idea! A standard library function to do it is a good idea. Looping within a process _is_ a bad idea in the UNIX operating system, but the C language is not supposed to be operating system specific. There are operating systems where forking a process is not possible (are you listening, Microsoft?). A standard event_wait() might be implemented differently where fork() is defined, but ought to exist, in some form, in the standard library for all supported environments, no? -- Dave Levenson Westmark, Inc. The Man in the Mooney Warren, NJ USA {rutgers | att}!westmark!dave