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!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: task synchronization and activation Date: Tue, 22 Feb 2005 08:17:57 +0100 Organization: Adalog Message-ID: <3bmevc.5mi.ln@hunter.axlog.fr> 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 1109059695 21109 195.25.228.57 (22 Feb 2005 08:08:15 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 22 Feb 2005 08:08:15 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: fr, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:8458 Date: 2005-02-22T08:17:57+01:00 List-Id: Robert A Duff a �crit : [...] > I can believe that that was the reasoning of the Ada 83 designers. > But I still don't quite agree with it. > > For one thing, if you want to handle exceptions in the decl part, > just change this: > > task body T is > ... -- possible exception here? > begin > ... > end T; > > to this: > > task body T is > begin > declare > ... -- possible exception here? > begin > ... > end; > exception > ... > end T; > > and now the task can handle it (because it's no longer in the task's > declarative part). So it's a case of "Doctor, it hurts when I...." > "So don't do that." ;-) It is not the same thing *at all*. Here, you are putting the responsibility on the task's side, but the issue is to be safe from the caller's point of view. Let's look at it differently. A program unit needs some subtasks to do its job. If the subtasks cannot be started for any reason (including storage_error), then the program unit cannot work, and it'd better be noticed of that; most likely, the program unit will raise an exception or find a fall-back strategy. Since asynchronous exceptions are horrible (Java did that mistake, and had to back-up), this must happen synchronously, and the logical point is just before executing any statement. Now, you can argue that the subtasks may fail at any later time; that's true, and Tasking_Error may be raised for any interaction. However, failing activation is basically not having the resources to start the servers, and is a much more severe condition. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr