[comp.lang.ada] interrupt entries and terminate alternatives

emery%aries@MITRE-BEDFORD.ARPA (David Emery) (11/06/87)

Consider the following:

  procedure P is

    task Tis
      entry INTERRUPT_ENTRY;
    end T;

    task body T is
    begin
      select
        accept INTERRUPT_ENTRY;
      or 
        terminate;
      end select;
    end T;
  begin
    -- do something for a while, and then finish up
    -- what happens to task T when we are finished here?
  end P;

RM 13.5.1 (3) says:
"If a select statement contains both a terminate alternative and an
accept alternative for an interrupt entry, then an implementation may
impose furhter requirements for the selection of the terminatean implementatioaddition to those given in section 9.4."

here are some words from 9.4
"Termination of a task otherwise takes place in and only if its
execution has reached an open terminate alternative in a select
statement and the following conditions are satisfied:
  *  The task depends on some master whose execution is completed
(hence not a library package)
  * Each task that depends on the master considered is either already
terminated or similarly waiting on an open terminate alternative of a
select statement."

Two questions:
  1.  based only on 9.4 (quoted and otherwise), will task T terminate
when the body of P is done?  If this is so, it would make it very hard
to install an "terminate and stay resident" interrupt handler,
wouldn't it? 
  2. In accordance with 13.5.1 (quoted above), does anyone have any
experience/knowledge with specific implementations of interrupt
entries and terminate alternatives?

			dave emery
			emery@mitre-bedford.arpa