Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!usc!jarthur!bridge2!3comvax!tymix!tardis!jms From: jms@tardis.Tymnet.COM (Joe Smith) Newsgroups: comp.sys.amiga Subject: Re: Lattice C 5.04 bug Message-ID: <873@tardis.Tymnet.COM> Date: 12 Dec 89 06:56:41 GMT References: <828@wet.UUCP> <12147@cbnewsc.ATT.COM> Reply-To: jms@tardis.Tymnet.COM (Joe Smith) Organization: BT Tymnet, San Jose, CA Lines: 40 In article bader+@andrew.cmu.edu (Miles Bader) writes: >I was under the impression that "Delay" was a pretty nasty thing to use, that >it stopped the whole system dead while it was delaying or something. ^^^^^^^^^^^^ only your task. The admonition was "Don't use Delay(0)" because at one time it destroyed the root directory of floppies. (Release 1.0 or something.) sleep(n) int n; { long ticks = n * 50; if (ticks == 0) ticks = 1; /* make sure it's not zero */ Delay(ticks); } However, Delay does prevent your process from doing anything else until the requested time elapses. In the case of Kermit, the program needs to wait until either a packet comes in on from the modem or until the timeout period expires. >gregg@cbnewsc.ATT.COM (gregg.g.wonderly) writes: >> Which brings me to my favorite gripe. Why do people insist on implementing >> compatibility libraries from the lowest level? It seems really rediculous >> to try and invent new bugs in software. My favorite is the sleep() >> implementation in C-Kermit. Instead of [see above] >> the code was written with huge amounts of StartIO/WaitIO and other such >> nonsense. Miles is right; Gregg is mistaken. Using sleep() as defined above would mean that Kermit would transfer one packet every 30 seconds. Sleep() in Unix works because your process can be woken up in the middle of the sleep. Delay() in AmigaDOS won't wake up early. -- Joe Smith (408)922-6220 | SMTP: JMS@F74.TYMNET.COM or jms@gemini.tymnet.com BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms PO Box 49019, MS-D21 | PDP-10 support: My car's license plate is "POPJ P," San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga speaks for me."