comp.lang.ada
 help / color / mirror / Atom feed
* Run-Time is stuck - tasks
@ 2003-12-19 17:52 Ratson Janiv
  0 siblings, 0 replies; only message in thread
From: Ratson Janiv @ 2003-12-19 17:52 UTC (permalink / raw)


My Task:

====================================================================

begin

while not Done loop

select


    accept Check(I:Integer;A: in out Arr) do


        Ada.Text_Io.Put("Check has started ");

        Ada.Text_Io.Put_Line("I = " & Natural'Image(I));

        Tmp_I := I;


    end Check;



    for J in 2..Tmp_I-1 loop

        if(Tmp_I mod J = 0) then

            Is_Prime := False;

        end if;

    end loop;


    case Tmp_I is

        when 1 => Tmp_I := 200000;

        when 2 => Tmp_I := 2000000;

        when 3 => Tmp_I := 17163282;

        when 4 => Tmp_I := 7634;

        when 5 => Tmp_I := 8728222;

        when 6 => Tmp_I := 99999999;

        when 7 => Tmp_I := 1;

        when 8 => Tmp_I := 837493;

        when others => Tmp_I := 0;

    end case;


    for J in 1..Tmp_I loop


        O := Tmp_I + 1 + 1 - 1 ;

    end loop;




    accept Update(A: in out Arr) do


        Ada.Text_Io.Put("Check has Ended ");

        A(Tmp_I) := Is_Prime;

        Ada.Text_Io.Put("Check has Ended2 ");

        Ada.Text_Io.Put_Line("I = " & Natural'Image(Tmp_I));

        Done := True;


    end Update;



end select;

end loop;

end T_Check;

============================================================================
=

the caller task:

****************************************************************************
*

while Num <= M loop


    if(I >= N) then

        I := 1;

    end if;


    Arr_Checks(I).Check(Num,Arr_Results);

    Ada.Text_Io.Put_Line("Manager has returned");

    Arr_Checks(I).Update(Arr_Results);

    Num := Num + 1;

    I := I + 1;

end loop;

****************************************************************************
**

It prints on the screen :

-------------------------------------------------------

Manager has started => N =  8 M =  100
Check has started I =  1
Manager has returned
Check has Ended

---------------------------------------------------------

it means that it is stuck on the Check has Ended2 row, why ?

thanks a lot,

Janiv.







^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-12-19 17:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-19 17:52 Run-Time is stuck - tasks Ratson Janiv

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