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 Path: g2news1.google.com!news4.google.com!news.glorb.com!news.newsland.it!proxad.net!freenix!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: task synchronization and activation Date: Mon, 21 Feb 2005 09:50:59 +0100 Organization: Adalog Message-ID: References: <5f59677c.0502190711.1d6d2492@posting.google.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1108976817 5011 195.25.228.57 (21 Feb 2005 09:06:57 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Mon, 21 Feb 2005 09:06:57 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: fr, en In-Reply-To: <5f59677c.0502190711.1d6d2492@posting.google.com> Xref: g2news1.google.com comp.lang.ada:8436 Date: 2005-02-21T09:50:59+01:00 List-Id: Evangelista Sami a �crit : > 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.2.5 of the 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? > It has to do with exceptions at elaboration. When a task is started, it first elaborates its declarative part. If exceptions are raised during this elaboration, they cannot be handled by the task itself, therefore it is necessary to notify *someone*, and the obvious "someone" is the activator. However, we don't want to have asynchronous exceptions, therefore the activator has to wait that all subtasks are (correctly) activated. Differently said: when an activator reaches the first statement after the begin, it is guaranteed that all subtasks have been correctly activated; otherwise, Tasking_Error is raised after begin (so it can be handled locally), but before the first statement. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr