comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: is there a 'wait' command in Ada
Date: 1996/12/10
Date: 1996-12-10T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.96Dec9193401@spectre.mitre.org> (raw)
In-Reply-To: Pine.SOL.3.91.961129204410.12801A-100000@sirius



   "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com> 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...




  parent reply	other threads:[~1996-12-10  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-29  0:00 is there a 'wait' command in Ada ***** LOTUS *****
1996-11-29  0:00 ` Robert A Duff
1996-11-30  0:00 ` Michael Feldman
1996-11-30  0:00   ` Robert Dewar
1996-12-01  0:00     ` Michael Feldman
1996-12-01  0:00       ` Robert Dewar
1996-12-02  0:00         ` Larry Kilgallen
1996-12-02  0:00         ` Michael Feldman
1996-12-02  0:00       ` David C. Hoos, Sr.
1996-12-09  0:00         ` Fergus Henderson
1996-12-02  0:00 ` Corey Minyard
1996-12-03  0:00   ` Larry Kilgallen
1996-12-03  0:00     ` Michael Feldman
1996-12-04  0:00       ` Larry Kilgallen
1996-12-03  0:00   ` Robert A Duff
1996-12-03  0:00   ` Michael Feldman
1996-12-03  0:00 ` Corey Minyard
1996-12-04  0:00   ` Robert Dewar
1996-12-04  0:00   ` Keith Thompson
1996-12-10  0:00 ` Robert I. Eachus [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-11-29  0:00 tmoran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox