Re: Very confused by Ada tasking, can not explain the execution outcome.
- From: Georg Bauhaus <rm.tsoh.plus-bug.bauhaus@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Aug 2008 15:40:15 +0200
climber.cui@xxxxxxxxx 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"
.
- References:
- Very confused by Ada tasking, can not explain the execution outcome.
- From: climber . cui
- Re: Very confused by Ada tasking, can not explain the execution outcome.
- From: Jeffrey R. Carter
- Re: Very confused by Ada tasking, can not explain the execution outcome.
- From: climber . cui
- Very confused by Ada tasking, can not explain the execution outcome.
- Prev by Date: Re: and then... (a curiosity)
- Next by Date: Re: and then... (a curiosity)
- Previous by thread: Re: Very confused by Ada tasking, can not explain the execution outcome.
- Next by thread: Re: Very confused by Ada tasking, can not explain the execution outcome.
- Index(es):
Relevant Pages
|