From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1495a7603c0b9648 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Some questions on task dependency Date: 09 Feb 2005 09:02:58 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <5f59677c.0502090530.7f29842f@posting.google.com> NNTP-Posting-Host: shell01-e.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1107957778 1975 69.38.147.31 (9 Feb 2005 14:02:58 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 9 Feb 2005 14:02:58 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:8208 Date: 2005-02-09T09:02:58-05:00 List-Id: 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