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=0.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1356f4179c1e4ef4 X-Google-Attributes: gid103376,public From: "Samuel T. Harris" Subject: Re: ADA task Date: 1996/09/13 Message-ID: <323A1FF2.2781@gsde.hso.link.com>#1/1 X-Deja-AN: 180513008 references: <5174qu$o1p@nr1.ottawa.istar.net> <51cjp0$q7k@watnews1.watson.ibm.com> content-type: text/plain; charset=us-ascii organization: Hughes Training Inc. - Houston Operations mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (X11; I; IRIX 5.3 IP19) Date: 1996-09-13T00:00:00+00:00 List-Id: Norman H. Cohen wrote: > ... delay until Next_Wakeup; > ... > > The "delay until" statement is a new feature in Ada 95. In Ada 83 you > would write Yes, this is a very nice addition to Ada 95, especially for us simulation folks. > > delay Next_Wakeup - Calendar.Clock; > > which delays for the specified amount of time (in this case, the time > from now until Next_Wakeup). Unfortunately, Ada 83 semantics specify only that the delay will be at least as long as the delay. It can be more then the delay (possible much more). It depends on the fidelity of the runtime system, the desired frequency, and the load caused by other tasks. An alternative is to use passive tasks with wakeup entries and tie a master task to a realtime clock interrupt. The master task then rendevous with the passive tasks. If all tasks are harmonic, then the least common multiple frequency is used and a simple clock pulse will suffice. If all tasks are not harmonic, then a programmable "alarm" is required based on an interval sequence determined by the least common multiple of all harmonic groups. When a "hit" occurs, the master task wakes all passive tasks on that frequency(ies) and uses the interval table to adjust the alarm for the next "hit". Of course, this all assumes only one alarm is available. If more than one alarm is available, then each harmonic group gets its own alarm and its own master task. Each alarm is programmed and used as a simple pulse and we are back to multiple instance of the first technique above. > > -- > Norman H. Cohen ncohen@watson.ibm.com -- Samuel T. Harris, Senior Engineer Hughes Training, Inc. - Houston Operations 2224 Bay Area Blvd. Houston, TX 77058-2099 "If you can make it, We can fake it!"