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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5a05d88755a62a0e X-Google-Attributes: gid103376,public From: "Norman H. Cohen" Subject: Re: Asynchronous Transfer of Control Date: 1996/10/22 Message-ID: <326D3CE6.3A2@watson.ibm.com>#1/1 X-Deja-AN: 191320959 references: <32656457.1A76@csehp1.mdc.com> content-type: text/plain; charset=us-ascii organization: IBM Thomas J. Watson Research Center mime-version: 1.0 reply-to: ncohen@watson.ibm.com newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (Win95; I) Date: 1996-10-22T00:00:00+00:00 List-Id: Robert Dewar wrote: > That being said, my advice is NEVER use ATC. As soon as your program can > have asyncrhonous aborts, you have to start worrying EVERYWHERE IN YOUR > PROGRAM about the possibility of a suddent abort occurring and leaving > data in an inconsistent state. This is made worse by the failure in Ada 95 > to provide convenient mechanisms for deferring abort. What, NEVER? Well, hardly ever. But ATC is safe as long as the abortable part implements a transaction, i.e., as long as it appears, at the end of the select statement, as having either taken place in its entirety or not having been started. In other words, ATC is safe as long as the abortable part has no side effects in cases where it is aborted. How often is ATC useful, given this restriction? Well, as I said, hardly ever. But here are some examples: o The user in an interactive application clicks a "Stop" button, indicating that some work is taking longer than he anticipated, and he would like to abandon it, discarding everything accomplished until that point. o A piece of periodic processing in a cyclic executive overruns its time slot and is abandoned, producing no result for that period. o In a parallel search, the first task to find the target of the search reports its victory by calling a protected procedure that opens an entry, triggering the abortion of the master of all the search tasks. o The last action in the abortable part is an atomic update of a pointer, to point to some data structure that is not accessible outside the abortable part until this update. The bulk of the work of the abortable part is to update the data structure pointed to, but none of this has any effect on the rest of the program if the abortable part never gets to the atomic update of the pointer. It is also safe if the work of the abortable part consists of a series of transactions, each of which is NATURALLY expressed as a protected operation. -- Norman H. Cohen mailto:ncohen@watson.ibm.com http://www.research.ibm.com/people/n/ncohen