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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a0f8bfc88538cab5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!news.tele.dk!not-for-mail Sender: malo@0x535ddcf0.boanxx18.adsl-dhcp.tele.dk Newsgroups: comp.lang.ada Subject: Re: task time-out&abort References: <1119463703.048124.135330@o13g2000cwo.googlegroups.com> From: Mark Lorenzen User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Date: 22 Jun 2005 21:44:45 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: TDC Totalloesninger NNTP-Posting-Host: 83.93.220.240 X-Trace: 1119469485 dtext01.news.tele.dk 183 83.93.220.240:18302 X-Complaints-To: abuse@post.tele.dk Xref: g2news1.google.com comp.lang.ada:11573 Date: 2005-06-22T21:44:45+02:00 List-Id: "e.coli" writes: > here the code... > ------------------------------------ > with Ada.Text_Io; > with Ada.Task_Identification; > > procedure Semplice2 is --processo genitore > > task Un_Task is--specifica > entry Uno; > entry Due; > end Un_Task; > > task body Un_Task is > begin > loop > select > accept Uno do > Ada.Text_Io.Put_Line("foo"); > end Uno; > or > accept Due do > Ada.Text_Io.Put_Line("buffering"); > loop -- ;) > delay(0.0); > end loop; > Ada.Text_Io.Put_Line("bar"); > end Due; > end select; > end loop; > end Un_Task; > > begin --corpo genitore > Un_Task.Uno; > Ada.Text_Io.Put_Line ("wait Horribly long calculation"); > select > delay 5.0; > Ada.Text_Io.Put_Line ("Horribly long calculation abandoned"); > then abort > un_task.due; > end select; > end Semplice2; > ----------------------------------------- > > but don't work... > how i can do the five second time out? > thanks As I see it, you have a calculation that may take a long time and you want to abandon that calculation, if some time constraint is reached. To do it the proper "Ada-way" you will need to use an other technique, see: http://www.adaic.com/standards/95aarm/html/AA-9-7-4.html - Mark Lorenzen