Re: ATC, an example please.



"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> 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
.



Relevant Pages

  • Re: Storage management
    ... Aborting blocking I/O is "guaranteed not to work"? ... There is no way Ada could abort I/O if the OS does not allow this. ... I would give 98% that it never will work with ATC. ... could not be aborted with ctrl-C. ...
    (comp.lang.ada)
  • Re: ATC, an example please.
    ... >> ATC transfers control, it does not abort any other task. ... it does abort any tasks inside the abortable region of the ATC. ...
    (comp.lang.ada)
  • Re: ATC, an example please.
    ... ATC transfers control, it does not abort any other task. ... entry Start; ... end loop; ...
    (comp.lang.ada)
  • RE: Need help regarding threading
    ... > This recursive function is adding some entries in my temprary file. ... > But when i called abort on thread it is not aborting that thread. ... > After calling aborting still entries are getting inserted into ...
    (microsoft.public.dotnet.general)
  • Re: Neither slavery nor involuntary servitude
    ... and Abort old queers instead of aborting the innocent?.. ... She was pro choice and quite the feminist and supporter of reason, ... She knew the greatest travesty of any society is the poisonous, ...
    (uk.philosophy.atheism)