comp.lang.ada
 help / color / mirror / Atom feed
* Some questions on task dependency
@ 2005-02-09 13:30 Evangelista Sami
  2005-02-09 14:02 ` Robert A Duff
  0 siblings, 1 reply; 2+ messages in thread
From: Evangelista Sami @ 2005-02-09 13:30 UTC (permalink / raw)


Hello all

Let us take this code :
---------------------------------------------
procedure Main_Proc is

   task type T;
   type Access_T is access T;
   type Array_T is array(1..10) of T;

   A_Dynamic_T : Access_T := new T;
   A_T : T;
   Some_Ts : Array_T;

   task body T is
      I : Integer;
   begin
      Dont_Care;
   end;

   J : Integer;

begin
   Do_Something;
end;
---------------------------------------------

I am interested in the behavior of the main procedure Main_Proc. I
carefully read the RM but i am not sure of what will exactly happen
with this program.
Is the following true :

1 - Main_Proc allocates A_Dynamic_T and waits for A_Dynamic_T.all to
finish its activation, i.e., declaration of I
2 - Once the activation of A_Dynamic_T.all finished Main_Proc can
pursue its declarations
3 - Main_Proc activates A_T, Some_Ts(1), ..., Some_Ts(10)
4 - Main_Proc is suspended on its begin and waits for A_T, Some_Ts(1),
..., Some_Ts(10) to finish their activation
5 - Main_Proc executes Do_Something
6 - Main_Proc is suspended on its end and waits for A_T, Some_Ts(1),
..., Some_Ts(10) to be terminated
7 - Main_Proc waits for the termination of all the tasks allocated by
an access varible of type Access_T, i.e., A_Dynamic_T.all
8 - Main_Proc is completely finalized by "freeing" variable J.

Thanks for any help

Sami



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

* Re: Some questions on task dependency
  2005-02-09 13:30 Some questions on task dependency Evangelista Sami
@ 2005-02-09 14:02 ` Robert A Duff
  0 siblings, 0 replies; 2+ messages in thread
From: Robert A Duff @ 2005-02-09 14:02 UTC (permalink / raw)


evangeli@cnam.fr (Evangelista Sami) writes:

> Hello all
> 
> Let us take this code :
> ---------------------------------------------
> procedure Main_Proc is
> 
>    task type T;
>    type Access_T is access T;
>    type Array_T is array(1..10) of T;
> 
>    A_Dynamic_T : Access_T := new T;
>    A_T : T;
>    Some_Ts : Array_T;
> 
>    task body T is
>       I : Integer;
>    begin
>       Dont_Care;
>    end;
> 
>    J : Integer;
> 
> begin
>    Do_Something;
> end;
> ---------------------------------------------
> 
> I am interested in the behavior of the main procedure Main_Proc. I
> carefully read the RM but i am not sure of what will exactly happen
> with this program.
> Is the following true :
> 
> 1 - Main_Proc allocates A_Dynamic_T and waits for A_Dynamic_T.all to
> finish its activation, i.e., declaration of I
> 2 - Once the activation of A_Dynamic_T.all finished Main_Proc can
> pursue its declarations
> 3 - Main_Proc activates A_T, Some_Ts(1), ..., Some_Ts(10)
> 4 - Main_Proc is suspended on its begin and waits for A_T, Some_Ts(1),
> ..., Some_Ts(10) to finish their activation
> 5 - Main_Proc executes Do_Something
> 6 - Main_Proc is suspended on its end and waits for A_T, Some_Ts(1),
> ..., Some_Ts(10) to be terminated
> 7 - Main_Proc waits for the termination of all the tasks allocated by
> an access varible of type Access_T, i.e., A_Dynamic_T.all
> 8 - Main_Proc is completely finalized by "freeing" variable J.

Yes, except that steps 6 and 7 are really just one step.
6/7: Main_Proc waits for all 12 tasks to terminate.

- Bob



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

end of thread, other threads:[~2005-02-09 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-09 13:30 Some questions on task dependency Evangelista Sami
2005-02-09 14:02 ` Robert A Duff

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