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,3b69de4361f731f1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newscon02.news.prodigy.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: ATC, an example please. Date: 30 Jun 2005 08:55:27 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1120121092.240284.285260@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1120136127 29276 192.74.137.71 (30 Jun 2005 12:55:27 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 30 Jun 2005 12:55:27 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:11761 Date: 2005-06-30T08:55:27-04:00 List-Id: "Dmitry A. Kazakov" writes: > ATC transfers control, it does not abort any other task. Well, it does abort any tasks inside the abortable region of the ATC. The task in this example could be moved inside the ATC, and then it would be aborted automatically. But I was under the impression that the original poster wanted to abort the processing inside the accept statement, and allow the task to loop back and accept entry calls again. I don't see the point of splitting into the Start and Ready entries, since the caller isn't doing anything useful in between. > N.B. This is a wrong way to do things. Don't use ATC if you cannot prove > that there is no other way. Yes. It is very difficult to program correctly when there are aborts (which includes ATC) lurking in the program. If you call any third-party code from an abortable place, you need to inspect every line of it. >... Don't abort task, which is even more brutal > than ATC. Not really. They both abort some code asynchronously, and whatever variables are written by that code will be destroyed in an unpredictable manner. The issues are the same for aborting a task as they are for aborting the abortable part of an ATC. Storage leaks are another issue with aborts (both kinds). - Bob