Subject: | |
From: | |
Reply To: | Coniam, Todd |
Date: | Tue, 18 Mar 1997 14:42:16 -0600 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Seems to work fine.
GNAT 3.09 (GCC 2.7.2) for Win32
(Windows 95 in a DOS window)
no source modifications
compiled using GNATMAKE with no switches.
Is this output what you expect?
---------------------------------------------------------------------
Todd Coniam, Master Sergeant, U.S. Air Force | Member: Team Ada
[log in to unmask] | Ada 95 - The World
Any opinions expressed are personal, and not | Standard In Modern OO
those of the U.S.A.F. or U.S. government. | Programming Languages.
---------------------------------------------------------------------
F:\tasktest>task_array2
in main
RENDEVOUS: 1
RENDEVOUS: 2
RENDEVOUS: 3
The_Task_Number: 1 I: 75000
RENDEVOUS: 4The_Task_Number: 3 I: 75000
The_Task_Number: 1 I: 150000The_Task_Number: 2 I: 75000
back in main
The_Task_Number: 2 I: 150000
The_Task_Number: 3 I: 150000
The_Task_Number: 4 I: 75000
The_Task_Number: 1 I: 225000
The_Task_Number: 3 I: 225000
The_Task_Number: 2 I: 225000
The_Task_Number: 4 I: 150000
The_Task_Number: 3 I: 300000
The_Task_Number: 1 I: 300000
The_Task_Number: 2 I: 300000The_Task_Number: 4 I: 225000
The_Task_Number: 3 I: 375000
The_Task_Number: 1 I: 375000
The_Task_Number: 4 I: 300000
The_Task_Number: 3 I: 450000The_Task_Number: 1 I: 450000
The_Task_Number: 4 I: 375000The_Task_Number: 2 I: 375000
The_Task_Number: 1 I: 525000
The_Task_Number: 2 I: 450000The_Task_Number: 4 I: 450000
The_Task_Number: 3 I: 525000
The_Task_Number: 1 I: 600000
The_Task_Number: 4 I: 525000
The_Task_Number: 3 I: 600000
The_Task_Number: 2 I: 525000The_Task_Number: 4 I: 600000
The_Task_Number: 1 I: 675000
The_Task_Number: 3 I: 675000
The_Task_Number: 4 I: 675000
The_Task_Number: 1 I: 750000
The_Task_Number: 3 I: 750000The_Task_Number: 4 I: 750000
The_Task_Number: 2 I: 600000
The_Task_Number: 2 I: 675000
The_Task_Number: 2 I: 750000
F:\tasktest>
>----------
>From: Paul Bence[SMTP:[log in to unmask]]
>Sent: Tuesday, March 18, 1997 12:24
>To: [log in to unmask]
>Subject: task arrays
>
>We are evaluating GNAT for possible use at Naval Fleet Numerical
>supercomputing
>center. Any assistance in clarifying what is going on in the simple
>code below
>would be greatly appreciated.
>
>Using GNAT 3.07: core dump or hang
>Using GNAT 3.01: Tasks 3,4 finish, tasks 1 and 2 do not. No errors
>reported.
>
>We routinely use data structures much larger that this, and have
>launched many
>more tasks at once (the example uses 4 tasks). We are using Solaris 2.5
>
>Regards,
>
>Paul Bence/Anteon Corp., potential_customer.multi_tasking_novice
>---------------------------------------------------------------------
>with Text_IO;
>
>procedure Task_Array2 is
>
> Natural_Array_Limit : constant NATURAL := 750_000;
> Loop_Step : constant NATURAL := Natural_Array_Limit / 10;
> Task_Array_Limit : constant NATURAL := 4;
>
> type Big_Array_T is array (1..Natural_Array_Limit) of NATURAL;
> type Matrix_T is array (1..Task_Array_Limit) of Big_Array_T;
>
> Matrix : Matrix_T;
>
> task type Array_Initializer is
>
> entry Initialize;
> entry Receive_Msg (Task_Number : in POSITIVE);
>
> end Array_Initializer;
>
> type Task_Array_T is array (1..Task_Array_Limit) of
>Array_Initializer;
>
> Task_Array : Task_Array_T;
> -------------------------------------------------------------------
> task body Array_Initializer is
>
> The_Task_Number : POSITIVE;
>
> begin
> accept Initialize;
>
> select
> accept Receive_Msg (Task_Number : in POSITIVE) do
> Text_IO.Put_Line ("RENDEVOUS: " & INTEGER'IMAGE
>(Task_Number));
> The_Task_Number := Task_Number;
> end Receive_Msg;
>
> for I in Big_Array_T'RANGE loop
> Matrix (The_Task_Number)(I) := 0;
> if (I mod Loop_Step) = 0 then
> Text_IO.Put_Line (
> "The_Task_Number: " & INTEGER'IMAGE (The_Task_Number)
> & " I: " & INTEGER'IMAGE (I));
> end if;
> end loop;
>
> -- or Terminate;
> end select;
>
> end Array_Initializer;
> -------------------------------------------------------------------
>begin
> Text_Io.Put_Line ("in main");
> for I in Task_Array'RANGE loop
> Task_Array (I).Initialize;
> Task_Array (I).Receive_Msg (Task_Number => I);
> end loop;
> Text_Io.Put_Line ("back in main");
>end Task_Array2;
>
>
>
|
|
|