[net.lang.ada] Propagation of exceptions raised within tasks

frigo@cernvax.UUCP (frigo) (06/02/86)

Re: Propagation of exceptions from tasks

Can anyone help me with this problem? It must e[Dbe a programming
error, but I can't find it...

The main procedure instantiates a package TASK_PAK, generic on
the number of tasks to be created. TASK_PAK declares an array
of records containing each a task component. The task body is
S[Dseparate(TASK_PAK).    

Each task has an exception handler of the form

    when OTHERS =>
       raise TASK_CH[DRASHED;

After starting all the tasks (they have an entry START) the main
procdu[D[Dedure goes in a loop in which it performs a selective entry
call to another task[D[D[D[D[D[D[D[D[D[D[D[D[D[CANOTHER task. The main procedure loop looks like this:

  begin
    loop
      select
        KEYBOARD.WAIT_FOR_SHUTDW[DOWN;
        ...
        exit;
      else
        delay 1 * SECS;
    end loop;
   [Dexception
    when TASK_CRASHED =>
      ...
  end;

Usin[D[D[D[DUsing the VAX/Ada de[D[D[D[D[D[D[D[D[D[Ddebugger under VAX/VMS, I can see the exception raisd[Ded
in one of the task being intercepted by the task excepion handler
and raised again as TASK_CRASHED.    However, the main program
stays de[D[DDELAYed on the selective entry call, and its exception
handler is not executed.    Why???

-- 
                       G. Vittorio FRIGO,
                       C.E.R.N., CH - 1211 Geneva 23, Switzerland