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,d676a4bf883e6826 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!logbridge.uoregon.edu!arclight.uoregon.edu!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: task synchronization and activation Date: 19 Feb 2005 15:05:19 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <5f59677c.0502190711.1d6d2492@posting.google.com> <18824603.NgNnWmvhLG@linux1.krischik.com> NNTP-Posting-Host: shell01-e.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1108843519 19184 69.38.147.31 (19 Feb 2005 20:05:19 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 19 Feb 2005 20:05:19 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:8425 Date: 2005-02-19T15:05:19-05:00 List-Id: Martin Krischik writes: > Evangelista Sami wrote: > > > Hello all > > > > Why does a task have to wait that all the tasks it created are > > activated before > > executing? I am thinking of point 9.particulare RM : > > > > "The task that created the new tasks and initiated their activations > > (the activator) is blocked until all of these activations complete > > (successfully or not)." > > > > I can understand that a master has to wait for the tasks he created > > before finalizing since in the other case it could "free" some memory > > needed by its children. > > But i cannot see why this synchronisation after activation is > > necessary. What is the technical reason? > > So you can make the first rendezvous with that task. It all depends on the > actual implementation but every task need some internal house keeping > informations and data structures for inter process comunication and they > need to be - savely - initialzed. I don't really agree with that. For one thing, two tasks that are activated together can (try to) rendezvous with each other. So they have to be prepared for entry calls coming in as soon as they are activated. (Of course, these entry calls wait until an appropriate accept statement.) So whatever internal housekeeping data structures are needed must be initialized by the activator (probably during task *creation*), before activating them. For another thing, the activator waits until the tasks reach their "begin". What's so different about the Ada code before and after the "begin"? And the tasks don't wait for each other to *all* reach their "begin"s -- just the activator waits. So my answer to Evangelista Sami's question is, "There is no good reason for this design." At least, I can't think of one. This extra synchronization is just a waste of time, as far as I can tell. One possibility is that the original designers were thinking about the fact that exceptions that occur before the "begin" can't be handled. But I don't see why that makes any real difference. - Bob