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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ebc5bf96039d7210 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!b1g2000hsg.googlegroups.com!not-for-mail From: climber.cui@gmail.com Newsgroups: comp.lang.ada Subject: Re: Very confused by Ada tasking, can not explain the execution outcome. Date: Sat, 30 Aug 2008 02:42:51 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 72.39.186.157 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1220089371 3571 127.0.0.1 (30 Aug 2008 09:42:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 30 Aug 2008 09:42:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b1g2000hsg.googlegroups.com; posting-host=72.39.186.157; posting-account=fnsQjAoAAACsmgRb2dWjnstJ3nliOcz6 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080410 SUSE/2.0.0.14-0.2.3 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:1836 Date: 2008-08-30T02:42:51-07:00 List-Id: On Aug 30, 1:12 am, "Jeffrey R. Carter" wrote: > climber....@gmail.com 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 . Thanks Jeff. It seems you are right. Some exceptions occurs during the task execution, and Ada is ignoring it. 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, that is it will evaluate every term(connected by logical operators), like in: if D