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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5400c39557b9f344,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-07 04:44:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!nycmny1-snf1.gtei.net!news.gtei.net!colt.net!news-lond.gip.net!news.gsl.net!gip.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor-online.net!news.belwue.de!contact.softwarezentrum.de!news.bawue.de!lemmies.lb.bawue.de!not-for-mail From: lemchens@lemmies.lb.bawue.de (arvids lemchens) Newsgroups: comp.lang.ada Subject: Multitasking Date: 07 Dec 2002 13:16:00 +0100 Organization: A poorly-maintained Debian GNU/Linux InterNetNews site Sender: news@pd9e62eda.dip.t-dialin.net Message-ID: <8bRwOT7FACB@lemmies.lb.bawue.de> NNTP-Posting-Host: pd9e62eda.dip.t-dialin.net X-Trace: pc4.dv-lemchens.de 1039264567 3130 192.168.2.6 (7 Dec 2002 12:36:07 GMT) User-Agent: OpenXP/32 v3.8.7pl1 (Linux) beta @ 2002-08-04-1336f Xref: archiver1.google.com comp.lang.ada:31524 Date: 2002-12-07T13:16:00+01:00 List-Id: Hi, playing around with tasks, i have following: ----- with Ada.Text_IO; use Ada.Text_IO; with Ada.Calendar; use Ada.Calendar; with Ada.Long_Long_Integer_Text_IO; use Ada.Long_Long_Integer_Text_IO; Procedure tt is task type TC is entry S(D : Positive); entry T(U : Positive); end TC; task body TC is begin loop select Accept S(D : In Positive) do delay Standard.duration(D); Put("Task S finished at "); Put(Long_Long_Integer(Seconds(Clock))); New_Line; end S; or Accept T(U : In Positive) do delay Standard.duration(U); Put("Task T finished at "); Put(Long_Long_Integer(Seconds(Clock))); New_Line; end T; or terminate; end select; end loop; end TC; type TCPtr is access TC; type TList is array (Positive range <>) of TCPtr; CList : TList(1..10000); begin CList(1) := new TC; Put("Start Task S at: "); Put(Long_Long_Integer(Seconds(Clock))); New_Line; CList(1).S(60); Put("End Task S "); Put(Long_Long_Integer(Seconds(Clock))); New_Line; Put("Start Task U "); Put(Long_Long_Integer(Seconds(Clock))); New_Line; CList(1).S(120); Put("End Task U "); Put(Long_Long_Integer(Seconds(Clock))); New_Line; end tt; ----- Output is: ----- Start Task S at: 46831 Task S finished at 46891 End Task S 46891 Start Task U 46891 Task S finished at 47011 End Task U 47011 ----- Now i am wondering why the maintask is waiting for the completion of S and T and not going independent of them on? Am i missing something fundamental about ada-tasks? If yes, what and how do i get them running independent? If it matters, i am using the linuxversion of gnat 3.14p. MvfG, Arvids