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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news4.google.com!news.glorb.com!newsfeed.stueberl.de!news.osn.de!diablo1-ffm.news.osn.de!noris.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Advice on abort Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1131117934.372137.244900@g44g2000cwa.googlegroups.com> Date: Fri, 4 Nov 2005 19:21:46 +0100 Message-ID: NNTP-Posting-Date: 04 Nov 2005 19:21:31 MET NNTP-Posting-Host: 5a92efe7.newsread2.arcor-online.net X-Trace: DXC=gPjh@h4bYiahlIa[YhA;>cQ5U85hF6f;djW\KbG]kaMhQ>n?D9BSA]lS5MJIjbEYgd[6LHn;2LCVn[ On 4 Nov 2005 07:25:34 -0800, 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? Close that socket from another task. That should end the blocking I/O on the socket with some error code. And the task will become ready accept a rendezvous. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de