Re: Very confused by Ada tasking, can not explain the execution outcome.



climber.cui@xxxxxxxxx wrote:
- the last sentence of the task body, which is a put_line statement
is never executed, but the task terminates.
- also, the per task counter 'rounds', was never incremented, it
stays the same as the initial value. The only procedure increment
'rounds' is procedure 'use_res', but the procedure was never called
during the execution. If you notice the entry condition for the while
loop, 'while rounds<2 loop', how could it get out of the loop if
'rounds' was never incremented?? why the program still terminates??

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.

--
Jeff Carter
"If I could find a sheriff who so offends the citizens of Rock
Ridge that his very appearance would drive them out of town ...
but where would I find such a man? Why am I asking you?"
Blazing Saddles
37
.



Relevant Pages