From: Lowe Anthony A <aalowe@cacd.rockwell.com>
To: Andre Heidenreich <heidenae@trick.informatik.uni-stuttgart.de>
Subject: Re: problem with tasking (ada95)
Date: 1998/05/04
Date: 1998-05-04T00:00:00+00:00 [thread overview]
Message-ID: <354DF03D.D6FEBC77@cacd.rockwell.com> (raw)
In-Reply-To: Pine.SOL.3.95.980429173033.19614A-100000@trick
I am not able to completely follow the flow here, I think too much has been
cut out. Inside the rendezvous there is a loop, but no end to the loop.
Also I can not find where the subprogram 'CreateClient' is being called.
Where does the caller of 'Server' reside? If you want/can send me more of
the code I would be glad to look at it some more. From what I can tell the
task type is fine, but with tasking it can be one of a thousand things
causing problems.
--
Tony Lowe Rockwell Collins
1431 Opus Place - Downers Grove, IL 60515
(630)-960-8603 Fax : (630)-960-8207
Andre Heidenreich wrote:
> hi all comp.lang.ada.reader,
>
> could anyone tell me, why the tasking in the followed source didn't work.
> the complatiton works correct, but when it was executed, the task of type
> clienttasktyp didn't want to start although the 'server' task send out
> an entry call ...Starten(-1).
>
> the sourcecode is not absolutely completely.
>
> thank you.
>
> --------------------------
> with Text_IO; use Text_IO;
> with vg; use vg;
>
> procedure Spiel is
>
> task type ClientTaskTyp is
> entry Starten(FirstPlayer : SpielerTyp);
> entry Spielen;
> entry Quit;
> end ClientTaskTyp;
>
> -------------------------
> -- task Clients
> -------------------------
>
> task body ClientTaskTyp is
> ...
> ActivePlayer : SpielerTyp;
> ...
>
> begin
> accept Starten(FirstPlayer : in SpielerTyp) do
> ActivePlayer := FirstPlayer;
> end Starten;
> loop
> select
> accept Spielen;
> loop
> Zugnr := Zugnr + 1;
> if ActivePlayer = 1 then -- Rechner
>
> ...
>
> UpdateTree(Spielfeld, Zugnr, -1);
> exit;
> end if;
> ActivePlayer := -ActivePlayer;
> end loop;
> or
> accept Quit;
> end select;
> end loop;
> end ClientTaskTyp;
>
> ------------------------
> -- task Server
> ------------------------
>
> task Server is
> entry Action;
> end Server;
>
> task body Server is
> package MyInt is new text_io.integer_io(integer);
>
> taskarray : array (1..10) of ClientTaskTyp;
>
> ...
>
> procedure CreateClient is
> begin
> ActivePlayer := Eingabe;
> RunningClients := RunningClients + 1;
> taskarray(RunningClients).Starten(ActivePlayer);
> taskarray(RunningClients).Spielen;
> end CreateClient;
>
> ...
>
> begin -- server task
> loop
> accept Action do
> loop
> ClrScr;
>
> ...
> Quitall;
> quit := true;
> when others => null;
> end case;
> end Action;
> exit when quit;
> end loop;
> end Server;
>
> ---------------------------------------------------
>
> begin -- main
> Server.Action;
> ClrScr;
> new_line;
> end Spiel;
>
>
> -- heidenae@trick.informatik.uni-stuttgart.de --
> -- heid.a@studbox.uni-stuttgart.de --
> -- heid.a@swol.de --
next prev parent reply other threads:[~1998-05-04 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-04-29 0:00 problem with tasking (ada95) Andre Heidenreich
1998-05-04 0:00 ` Lowe Anthony A [this message]
1998-05-09 0:00 ` Dr. Hubert B. Keller
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox