comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: ATC, an  example please.
Date: 30 Jun 2005 08:55:27 -0400
Date: 2005-06-30T08:55:27-04:00	[thread overview]
Message-ID: <wccbr5ongw0.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: efd7io46aiw$.1a88j118jl2sf$.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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



  parent reply	other threads:[~2005-06-30 12:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-30  8:44 ATC, an example please e.coli
2005-06-30  9:32 ` Dmitry A. Kazakov
2005-06-30  9:59   ` e.coli
2005-06-30 11:06   ` Christoph Grein
2005-06-30 12:55   ` Robert A Duff [this message]
2005-06-30 15:29     ` Dmitry A. Kazakov
2005-06-30 20:31       ` Robert A Duff
2005-06-30  9:32 ` e.coli
2005-07-02  8:18 ` Craig Carey
replies disabled

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