with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
task My_Task;
task body My_Task is
begin
Put_Line ("Hello from My_Task");
end;
begin
Put_Line ("Hello from Main");
end;
Result
The order of Put_Line can vary.
Hello from My_Task
Hello from ...
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
task My_Task;
task body My_Task is
begin
for I in 1 .. 4 loop
Put_Line ("Hello from My_Task");
end loop;
end;
begin
Put_Line ("Hello from Main");
end;
Result
The order of Put...
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
task My_Task;
task body My_Task is
begin
for I in 1 .. 4 loop
Put_Line ("Hello from My_Task");
end loop;
end;
begin
for I in 1 .. 4 loop
Put_Line ("Hello from Main");
e...
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
task My_Task_1;
task My_Task_2;
task body My_Task_1 is
begin
for I in 1 .. 4 loop
Put_Line ("Hello from My_Task_1");
end loop;
end;
task body My_Task_2 is
begin
for ...
The user can call Incrementor.Increment K number of times by pressing a key within '0' .. '9' and it's possible to call Incrementor.Increment faster than the task Incrementor can increment I.
with Ada.Text_IO;
with Ada.Integer_Text_IO;
procedure Main is
use Ada.Text_IO;
task Incrementor...
Interrupts are handled by a protected procedure with no parameters.
------------------------------------------------------------------
-- Interrupt Counting Package --
------------------------------------------------------------------
with Ada.Interrupts.Names; use Ada.Interrupts.Names;
packa...