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,be3d89c2ad66a506 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!news.tele.dk!not-for-mail Date: Mon, 07 Nov 2005 15:55:20 +0100 From: Poul-Erik Andreasen User-Agent: Debian Thunderbird 1.0.2 (X11/20050817) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Advice on abort References: <1131117934.372137.244900@g44g2000cwa.googlegroups.com> In-Reply-To: <1131117934.372137.244900@g44g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <436f6ad8$0$196$edfadb0f@dread11.news.tele.dk> Organization: TDC Totalloesninger NNTP-Posting-Host: 80.166.145.174 X-Trace: 1131375320 dread11.news.tele.dk 196 80.166.145.174:57138 X-Complaints-To: abuse@post.tele.dk Xref: g2news1.google.com comp.lang.ada:6267 Date: 2005-11-07T15:55:20+01:00 List-Id: REH wrote: > What are the best options when a task needs to be terminated, but > signaling the task may not be possible? We have tasks that sometimes > need to be terminated, but may potentially be blocked on a resource, > such as a socket. Currently we use OS-specific calls to terminate the > task, but I've never liked that. I've been thinking of using the abort > statement, but I don't think that's very graceful either. I also would > rather not complicate the code (or force polling behavior) by making > the sockets non-blocking. Any advice? > One poosibillty is too use asyncronius transfer of control. Somthing like this. select call.foo_entry -- this i is a guarded entry in a protected object or -- another task -- her can you have anything yuo may need to clean up after the abort then abort listen_to_socket this is the function wich may be blocked end select Thee foo_entry basicly dosen't need to do anything. an you have onother procedure or entry to open it. PEA.