comp.lang.ada
 help / color / mirror / Atom feed
From: Jean-Pierre Rosen <rosen@adalog.fr>
Subject: Re: task synchronization and activation
Date: Tue, 22 Feb 2005 08:17:57 +0100
Date: 2005-02-22T08:17:57+01:00	[thread overview]
Message-ID: <3bmevc.5mi.ln@hunter.axlog.fr> (raw)
In-Reply-To: <wcchdk54lxu.fsf@shell01.TheWorld.com>

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



  parent reply	other threads:[~2005-02-22  7:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-19 15:11 task synchronization and activation Evangelista Sami
2005-02-19 16:11 ` Martin Krischik
2005-02-19 18:11   ` Ed Falis
2005-02-19 20:05   ` Robert A Duff
2005-02-20 10:47     ` Martin Krischik
2005-02-21 19:25     ` Dmitry A. Kazakov
2005-02-21  8:50 ` Jean-Pierre Rosen
2005-02-21 21:55   ` Robert A Duff
2005-02-22  0:01     ` Randy Brukardt
2005-02-22  7:17     ` Jean-Pierre Rosen [this message]
2005-02-23  2:24       ` Robert A Duff
2005-02-23  7:58         ` Martin Krischik
replies disabled

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