comp.lang.ada
 help / color / mirror / Atom feed
From: "Norman H. Cohen" <ncohen@watson.ibm.com>
Subject: Re: Asynchronous Transfer of Control
Date: 1996/10/22
Date: 1996-10-22T00:00:00+00:00	[thread overview]
Message-ID: <326D3CE6.3A2@watson.ibm.com> (raw)
In-Reply-To: dewar.845732555@merv


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




  parent reply	other threads:[~1996-10-22  0:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-16  0:00 Asynchronous Transfer of Control James Squire
1996-10-16  0:00 ` Robert Dewar
1996-10-23  0:00   ` James Squire
1996-10-23  0:00     ` Robert Dewar
1996-10-17  0:00 ` Tucker Taft
1996-10-17  0:00   ` Robert A Duff
1996-10-17  0:00     ` Latest /= Greatest (was: Asynchronous Transfer of Control) Larry Kilgallen
1996-10-22  0:00       ` Asynchronous Transfer of Control Dale Stanbrough
1996-10-18  0:00     ` Ken Cowan
1996-10-18  0:00       ` Robert A Duff
1996-10-19  0:00       ` Robert Dewar
1996-10-21  0:00         ` Philip Brashear
1996-10-21  0:00           ` Validation vs. Certification (was: Asynchronous Transfer of Control) Larry Kilgallen
1996-10-21  0:00           ` Asynchronous Transfer of Control Robert Dewar
1996-10-21  0:00             ` Larry Kilgallen
1996-10-26  0:00               ` Robert Dewar
1996-10-22  0:00         ` Norman H. Cohen [this message]
1996-10-21  0:00       ` Pascal Ledru
1996-10-22  0:00     ` Jon S Anthony
1996-10-23  0:00     ` James Squire
1996-10-23  0:00       ` Robert Dewar
1996-10-29  0:00         ` m193884
1996-10-29  0:00           ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2014-04-10 10:41 AdaMagica
2014-04-10 14:43 ` Dmitry A. Kazakov
2014-04-10 15:15 ` Adam Beneschan
2014-04-10 17:36   ` Adam Beneschan
2014-04-10 22:49   ` Randy Brukardt
2014-04-10 23:16     ` Adam Beneschan
2014-04-10 18:44 ` AdaMagica
2014-04-10 19:07 ` sbelmont700
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox