comp.lang.ada
 help / color / mirror / Atom feed
From: Stribor40 <ikamzic@gmail.com>
Subject: Concurrency in Ada
Date: Sun, 7 Sep 2014 05:29:34 -0700 (PDT)
Date: 2014-09-07T05:29:34-07:00	[thread overview]
Message-ID: <4d9466ad-5c9e-4b1f-8797-def623b3beb6@googlegroups.com> (raw)

I have this program from online tutorial that says that tasks will run as soon as program starts. My question is when does this program starts on what line if code
WITH Ada.Text_IO;                  --  Include Text_IO Library
WITH Ada.Integer_Text_IO;          --  Include Integer Text_IO Library
PROCEDURE task_demo_01 IS
                                   --  Task Type Specification
     TASK TYPE intro_task (message : Integer);

     TASK BODY intro_task IS       --  Task Body Definition
     BEGIN
          FOR count IN 1..5 LOOP
               Ada.Text_IO.put (Item => "Display from Task ");
               Ada.Integer_Text_IO.put (Item => message, Width => 1);
               Ada.Text_IO.new_line;
          END LOOP;
     END intro_task;
     --  Unlike procedures, these tasks are not called.
     --  These three tasks are activated once the program begins.
     Task_1 : intro_task (message => 1);
     Task_2 : intro_task (message => 2);
     Task_3 : intro_task (message => 3);
BEGIN                                           
     NULL;                                   
END task_demo_01;

Do tasks run all at same tine or they are scheduled by OS which would mean anytime you run this program output would be different? 


             reply	other threads:[~2014-09-07 12:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-07 12:29 Stribor40 [this message]
2014-09-07 15:05 ` Concurrency in Ada Dennis Lee Bieber
2014-09-07 18:06 ` Jeffrey Carter
  -- strict thread matches above, loose matches on Subject: below --
1996-12-03  0:00 Javier Crespo
1996-12-03  0:00 ` Greg Bond
1996-12-03  0:00 ` Michael Feldman
1996-12-18  0:00 ` elaine.waybright
replies disabled

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