From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9cb6352457d1c6de X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: is there a 'wait' command in Ada Date: 1996/12/10 Message-ID: #1/1 X-Deja-AN: 203264260 references: organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-12-10T00:00:00+00:00 List-Id: "David C. Hoos, Sr." writes: >Have you ever thought of using the UNIX select function to implement a >"delay that doesn't burn CPU cycles or issue s shell command? >All you need to do is set all three of the file descriptor mask addresses >to null addresses, and point to a timeval structure initialized with the >desired delay time, and the UNIX kernel will swap you out until the time >has expired. Works like a champ! It looks like what everyone is looking for is an implementation of delay with the effective logic: if Number_of_Tasks = 1 then Unix.Sleep(N) else Ada.Runtime.Delay(N); end if; (I plan on general prinicples to ignore any discussion of the "extra overhead" in doing things this way. If you execute a delay statement you should only complain if it doesn't take as long as requested, and a busy wait is an appropriate implementation for very short delays.) Also it should be the case that a runtime which supports pragma Restrictions(Max_Tasks => 0) should not load the tasking runtime, even if this requires special support for (more efficient) protected types. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...