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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,345c606ef362d7fe,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-20 02:58:22 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.213.112.26!newsfeed1.ulv.nextra.no!nextra.com!peernews.cix.co.uk!newspeer1-gui.server.ntli.net!ntli.net!news11-gui.server.ntli.net.POSTED!not-for-mail From: "chris.danx" Newsgroups: comp.lang.ada Subject: multitasking: finishing execution X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <1HhQ8.8744$ZP1.1591823@news11-gui.server.ntli.net> Date: Thu, 20 Jun 2002 10:57:55 +0100 NNTP-Posting-Host: 80.5.140.234 X-Complaints-To: abuse@ntlworld.com X-Trace: news11-gui.server.ntli.net 1024567101 80.5.140.234 (Thu, 20 Jun 2002 10:58:21 BST) NNTP-Posting-Date: Thu, 20 Jun 2002 10:58:21 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:26467 Date: 2002-06-20T10:57:55+01:00 List-Id: Hi, Is calling the entry finish sufficient to terminate the task? The code of the entry isn't the concern, but the behaviour of entries. Consider the following procedure procedure finish_tasks is begin some_task.finish; -- 1 ada.text_io.put ("some_task should have terminated"); -- 2 end finish_tasks; -- sample task code -- loop select accept Finish; exit; else -- do some processing (sample code) -- if x < integer'last then x := x + 1; end if; end select; end loop; Can the call to some_task.finish time out? If it can there's no guarantee that the task has finished executing before the call to ada.text_io.put is executed and the program may fail to terminate because it has running tasks, correct? As you can see I'm a little confused by the fact that an entry can time out. Does it mean that the call can time out no matter what or that the task has to contain the appropriate code for an entry call to time out (such as a delay altenative)? i.e. will the procedure wait indefinitely for the task to terminate or will it abandon the entry call after some time elapses? If the code doesn't work as intended, what solution would you recommend? Is there a better way? Thanks, Chris