comp.lang.ada
 help / color / mirror / Atom feed
* All possible results?
@ 1987-09-04 18:48 HAERIM LEE
  0 siblings, 0 replies; 2+ messages in thread
From: HAERIM LEE @ 1987-09-04 18:48 UTC (permalink / raw)


-- What are all possible results of the execution of the following
-- code on BOTH a single processor system and a multi-processor system?
-- Can an exception 'TASKING_ERROR' be raised at (***)?  Or will "accepted"
-- be ALWAYS printed on the screen?  Or sometimes printing "accepted" and
-- sometimes raising 'TASKING_ERROR' will occur?  Please consider BOTH
-- systems mentioned above.  Send any comments to IE53@NTSUVAX.

with text_io; use text_io;
procedure kill is
  task a is
    entry e;
  end a;
  task body a is
  begin
    select
        accept e do
          put_line("accepted");
        end e;
    or
        terminate;
    end select;
  end a;
begin
  a.e;          -- ***
end kill;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: All possible results?
       [not found] <ie53%NTSUVAX.BITNET@wiscvm.wisc.edu>
@ 1987-09-04 19:50 ` Geoff Mendal
  0 siblings, 0 replies; 2+ messages in thread
From: Geoff Mendal @ 1987-09-04 19:50 UTC (permalink / raw)


"accepted" must be printed no matter what implementation the
program is executed on.  TASKING_ERROR cannot occur as a result
of kill calling t.a (at least, not in this simple program).

The semantics of the terminate alternative guarantee that the task
(task a) cannot complete while any other task (in this case, the
thread of control executing procedure kill) can call one of a's
entries.  For details, read RM 9.4 and 9.7.1(10).

gom
-------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1987-09-04 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1987-09-04 18:48 All possible results? HAERIM LEE
     [not found] <ie53%NTSUVAX.BITNET@wiscvm.wisc.edu>
1987-09-04 19:50 ` Geoff Mendal

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