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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.148.2 with SMTP id u2mr6846052yhj.55.1409945450700; Fri, 05 Sep 2014 12:30:50 -0700 (PDT) X-Received: by 10.140.83.180 with SMTP id j49mr299444qgd.1.1409945450632; Fri, 05 Sep 2014 12:30:50 -0700 (PDT) Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!dc16no1470859qab.1!news-out.google.com!i10ni2qaf.0!nntp.google.com!m5no6106973qaj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 5 Sep 2014 12:30:49 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.240.227.47; posting-account=sDyr7QoAAAA7hiaifqt-gaKY2K7OZ8RQ NNTP-Posting-Host: 87.240.227.47 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6967b17b-acb9-4b44-b21a-6ddcab1e1065@googlegroups.com> Subject: Strange behavior From: Laurent Injection-Date: Fri, 05 Sep 2014 19:30:50 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.dca.giganews.com comp.lang.ada:188879 Date: 2014-09-05T12:30:49-07:00 List-Id: Hi I have a strange behavior with this simple tasking example: https://github.com/Chutulu/chapter_17.git with Ada.Text_IO; procedure Two_Cooperating_Tasks is task type Simple_Task (Message : Character; How_Many : Positive); task body Simple_Task is begin -- Simple_Task for Count in 1 .. How_Many loop Ada.Text_IO.Put ("Hello from Task " & Message); Ada.Text_IO.New_Line; delay 0.1; end loop; end Simple_Task; Task_A : Simple_Task (Message => 'A', How_Many => 5); Task_B : Simple_Task (Message => 'B', How_Many => 5); begin -- Two_Cooperating_Tasks null; end Two_Cooperating_Tasks; when I run the program I get this: /Volumes/Kingston/GPS/Chapter 17/Build/two_cooperating_tasks Hello from Task BHello from Task A Hello from Task AHello from Task B Hello from Task A Hello from Task B Hello from Task A Hello from Task B Hello from Task AHello from Task B [2014-09-05 21:17:14] process terminated successfully, elapsed time: 00.68s If the program runs again the result is again different. The order of the tasks executing is random and that is ok but why is it changing and why is the New_Line zapped? Using gnat 2014 on MacOS 10.9 Thanks Laurent