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!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: task time-out&abort Date: 28 Jun 2005 17:31:13 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1119463703.048124.135330@o13g2000cwo.googlegroups.com> <1119540379.606416.227950@z14g2000cwz.googlegroups.com> <1119543599.616520.185540@g47g2000cwa.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1119994274 26312 192.74.137.71 (28 Jun 2005 21:31:14 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 28 Jun 2005 21:31:14 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:11710 Date: 2005-06-28T17:31:13-04:00 List-Id: Marius Amado Alves writes: > > My goal is that the calling process can abort the call after x second > > if the computation of the entry take too much time. > > Curiously enough on 2001 I wrote this for an Ada-Europe workshop on > exceptions: > > << > The time-out situation is so common that perhaps it deserves a special > device in a future Ada: > > begin > ... > end in 10.0; -- end in 10 seconds, or raise Time_Out > exception > when Time_Out => ... > >> > (http://www.liacc.up.pt/~maa/files/ehada1.pdf) How is this better than ATC (select-then-abort) in Ada 95? Note that dynamically nested time-out regions won't work very well in the above. You need a distinct new exception for each time-out, and you need to prevent hijacking of the exception. - Bob