with RTL.Fifo; use RTL.Fifo; with Interfaces.C.Strings; use Interfaces.C.Strings; with Ada.Streams; use Ada.Streams; with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with Ada.Text_IO; use Ada.Text_IO; procedure Rtfifo is Fifo : Fifo_Type; task T1 is end T1; task body T1 is Channel : Stream_Access; Message : String := Float'Image(10.1);-- "Good Bye"; begin delay 2.0; Channel := Stream (Fifo); loop Put_Line (">>>>> [Task 1] Message: " & Message); String'Output (Channel, Message); delay 4.0; end loop; exception when others => Put_Line ("Task 1: Exception"); end T1; task T2 is end T2; task body T2 is Channel : Stream_Access; begin delay 1.0; Channel := Stream (Fifo); loop declare Message : String := String'Input (Channel); begin Put_Line ("----- [Task 2] The message is: " & Message); delay 1.0; end; end loop; exception when others => Put_Line ("Task 2: Exception"); end T2; begin Create_Fifo (15, Fifo, Blocking); -- Destroy_Fifo (Fifo); exception when others => Put_Line ("There is an error\n"); end Rtfifo;