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.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,325a055bed62c230 X-Google-Attributes: gid103376,public From: reason67@my-deja.com Subject: Re: Apex vs GNAT on solaris Date: 1999/12/07 Message-ID: <82hkcn$899$1@nnrp1.deja.com> X-Deja-AN: 557292371 References: <82hiuj$74o$1@nnrp1.deja.com> X-Http-Proxy: NetCache@www-blv-proxy3.boeing.com: Version NetApp Release 3.4D6: Mon Aug 23 16:40:19 PDT 1999-Solaris, 1.0 x32.deja.com:80 (Squid/1.1.22) for client 12.13.226.13 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Tue Dec 07 00:29:15 1999 GMT X-MyDeja-Info: XMYDJUIDreason67 Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.06 [en] (X11; I; SunOS 5.6 sun4u) Date: 1999-12-07T00:00:00+00:00 List-Id: > 4.0 configurable number of task pairs one calling the others > rendezvous. -=-=-=-=-=-=- with Ada.Calendar; with Ada.Text_Io; with Common_Utilities; procedure Aaaa_4_0_Rendezvous is Compiler : constant String := "Apex"; Maximum_Task_Pairs : constant := 10; Setup_Time : constant Duration := 5.0; Run_Duration : constant Duration := 60.0; function "<" (Left : in Ada.Calendar.Time; Right : in Ada.Calendar.Time) return Boolean renames Ada.Calendar."<"; function "+" (Left : in Ada.Calendar.Time; Right : in Duration) return Ada.Calendar.Time renames Ada.Calendar."+"; task type Sender_Type is entry Set_Up (Number : in Integer; Start_Time : in Ada.Calendar.Time; End_Time : in Ada.Calendar.Time); entry Stop (Rendezvous_Count : out Integer); end Sender_Type; task type Receiver_Type is entry Timing_Entry; end Receiver_Type; type Sender_Array_Type is array (1 .. Maximum_Task_Pairs) of Sender_Type; type Receiver_Array_Type is array (1 .. Maximum_Task_Pairs) of Receiver_Type; Sender_Array : Sender_Array_Type; Receiver_Array : Receiver_Array_Type; Begin_Time : Ada.Calendar.Time; End_Time : Ada.Calendar.Time; Max_Rendezvous : Integer := -1; Min_Rendezvous : Integer := Integer'Last; Total : Integer := 0; Average : Integer := 0; Current : Integer; task body Sender_Type is Receiver_Number : Integer; Start : Ada.Calendar.Time; Finish : Ada.Calendar.Time; Number_Of_Rendezvous : Integer := 0; begin accept Set_Up (Number : in Integer; Start_Time : in Ada.Calendar.Time; End_Time : in Ada.Calendar.Time) do Receiver_Number := Number; Start := Start_Time; Finish := End_Time; end Set_Up; delay until Start; -- -- loop until the Finish time has occured -- while Ada.Calendar.Clock < Finish loop Receiver_Array (Receiver_Number).Timing_Entry; Number_Of_Rendezvous := Number_Of_Rendezvous + 1; delay 0.0; end loop; -- -- Gather statistics and terminate the task. -- accept Stop (Rendezvous_Count : out Integer) do Rendezvous_Count := Number_Of_Rendezvous; end Stop; end Sender_Type; -- -- Simple task that accepts rendezvous until the calling parent task ends -- task body Receiver_Type is begin loop select accept Timing_Entry; or terminate; end select; end loop; end Receiver_Type; begin Ada.Text_Io.Put_Line ("::: [Aaaa_4_0_Rendezvous]"); Begin_Time := Ada.Calendar.Clock + Setup_Time; End_Time := Begin_Time + Run_Duration; -- -- Loop through all senders and tell it the common start time, end time, -- and the number of the receiver task it should call. -- for Index in 1 .. Maximum_Task_Pairs loop Sender_Array (Index).Set_Up (Number => Index, Start_Time => Begin_Time, End_Time => End_Time); end loop; -- -- Gather the statistic information. It should hang on the Stop entry -- until the completion time occurs. -- for Index in 1 .. Maximum_Task_Pairs loop Sender_Array (Index).Stop (Rendezvous_Count => Current); Total := Total + Current; if Current > Max_Rendezvous then Max_Rendezvous := Current; end if; if Current < Min_Rendezvous then Min_Rendezvous := Current; end if; end loop; Average := Total / Maximum_Task_Pairs; -- -- Output the results -- Ada.Text_Io.Put_Line (Compiler & " reporting for " & Common_Utilities.Strip_Spaces (Duration'Image (Run_Duration)) & " sec. run with " & Common_Utilities.Strip_Spaces (Integer'Image (Maximum_Task_Pairs)) & " pairs of tasks (no Data):"); Ada.Text_Io.New_Line; Ada.Text_Io.Put_Line ("Total Rendezvous : " & Common_Utilities.Strip_Spaces (Integer'Image (Total))); Ada.Text_Io.Put_Line ("Max Rendezvous in 1 pair : " & Common_Utilities.Strip_Spaces (Integer'Image (Max_Rendezvous))); Ada.Text_Io.Put_Line ("Min Rendezvous in 1 pair : " & Common_Utilities.Strip_Spaces (Integer'Image (Min_Rendezvous))); Ada.Text_Io.Put_Line ("Average Rendezvous per pair : " & Common_Utilities.Strip_Spaces (Integer'Image (Average))); Ada.Text_Io.Put_Line ("::: [Aaaa_4_0_Rendezvous has finished.]"); end Aaaa_4_0_Rendezvous; -=-=-=-=-=-=-=-=-= Apex Reporting for Run with 1 pair of tasks (no Data): Total Rendesvous : 263062 -=-=-=-=- GNAT Reporting for Run with 1 pair of tasks (no Data): Total Rendesvous : 676564 -=-=-=-=- Apex Reporting for Run with 10 pairs of tasks (No Data): Total Rendesvous : 703448 Max Rendesvous in 1 pair : 73407 Min Rendesvous in 1 pair : 67145 Average rendesvous per pair : 70344 -=-=-=-=- GNAT Reporting for Run with 10 pairs of tasks (no Data): Total Rendesvous : 624886 Max Rendesvous in 1 pair : 72561 Min Rendesvous in 1 pair : 56665 Average rendesvous per pair : 62488 -=-=-=-=- Apex Reporting for Run with 100 pairs of tasks (No Data): Total Rendesvous : 612376 Max Rendesvous in 1 pair : 6229 Min Rendesvous in 1 pair : 5971 Average rendesvous per pair : 6123 -=-=-=-=- GNAT Reporting for Run with 100 pairs of tasks (no Data): Total Rendesvous : 578667 Max Rendesvous in 1 pair : 6636 Min Rendesvous in 1 pair : 5263 Average rendesvous per pair : 5786 -=-=-=-=- Apex Reporting for Run with 1000 pairs of tasks (no Data): Total Rendesvous : 385579 Max Rendesvous in 1 pair : 414 Min Rendesvous in 1 pair : 360 Average rendesvous per pair : 385 -=-=-=-=- GNAT Reporting for Run with 1000 pairs of tasks (no Data): Total Rendesvous : 113781 Max Rendesvous in 1 pair : 221 Min Rendesvous in 1 pair : 86 Average rendesvous per pair : 113 Sent via Deja.com http://www.deja.com/ Before you buy.