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.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,653536bc97e30bb8 X-Google-Attributes: gid103376,public From: Lowe Anthony A Subject: Re: problem with tasking (ada95) Date: 1998/05/04 Message-ID: <354DF03D.D6FEBC77@cacd.rockwell.com>#1/1 X-Deja-AN: 350181149 Content-Transfer-Encoding: 7bit References: To: Andre Heidenreich Content-Type: text/plain; charset=us-ascii Organization: Rockwell A&C Mime-Version: 1.0 Reply-To: aalowe@cacd.rockwell.com Newsgroups: comp.lang.ada Date: 1998-05-04T00:00:00+00:00 List-Id: 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 --