comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.tsoh.plus-bug.bauhaus@maps.futureapps.de>
Subject: Re: Very confused by Ada tasking, can not explain the execution outcome.
Date: Sat, 30 Aug 2008 15:40:15 +0200
Date: 2008-08-30T15:40:16+02:00	[thread overview]
Message-ID: <48b94dc0$0$11749$9b4e6d93@newsspool1.arcor-online.net> (raw)
In-Reply-To: <bc6367fc-831c-4e83-824b-e93dff1c2907@b1g2000hsg.googlegroups.com>

climber.cui@gmail.com wrote:
> On Aug 30, 1:12 am, "Jeffrey R. Carter"

>> If an exception occurs in your task, the task will terminate silently. This is a
>> way your task and program could terminate although it never increments Rounds
>> nor executes its final statement.

> Thanks Jeff. It seems you are right.  Some exceptions occurs during
> the task execution, and Ada is ignoring it.

Ada is not actually ignoring exceptions in tasks; the program
is following the Ada rules: Add these lines,

      Put_Line("TASK EXITS ::  rounds =" & INTEGER'Image(rounds) &
        "...." );

   exception
      when X: others =>
         Put_Line("TASK failed due to " &
           Ada.Exceptions.Exception_Information(X));
   end User_thread;

and you should see something like
TASK failed due to Exception name: CONSTRAINT_ERROR
Message: multi_res_alloc_a.adb:131 index check failed

So, yes,
> It is very likely to the
> 'array index out of bound'.



>  I doubt that Ada follows the strict
> evaluation rules when it evaluates the boolean expressions,

you would specify short circuit evaluation using "and then"
etc. as explained by Damien Carbonne;  Ada follows the rules
defined in the LRM, section

 "4.5.1 Logical Operators and Short-circuit Control Forms"




      reply	other threads:[~2008-08-30 13:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-30  1:54 Very confused by Ada tasking, can not explain the execution outcome climber.cui
2008-08-30  4:17 ` jimmaureenrogers
2008-08-30  9:34   ` climber.cui
2008-08-30 10:59     ` Damien Carbonne
2008-08-31 13:37       ` Stephen Leake
2008-08-30  5:12 ` Jeffrey R. Carter
2008-08-30  9:42   ` climber.cui
2008-08-30 13:40     ` Georg Bauhaus [this message]
replies disabled

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