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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6b353437b73507a5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!proxad.net!freenix!oleane.net!oleane!skymaster!nobody From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: Basic program with tasks goes out of memory Date: Fri, 6 Aug 2004 11:53:32 +0200 Organization: Adalog Message-ID: References: <5ad0dd8a.0408050655.355fa926@posting.google.com> <2nf4m2F7cpkU1@uni-berlin.de> <2ngv8lFnp34U1@uni-berlin.de> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s5.feed.news.oleane.net 1091786664 18986 195.25.228.57 (6 Aug 2004 10:04:24 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 6 Aug 2004 10:04:24 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Xref: g2news1.google.com comp.lang.ada:2600 Date: 2004-08-06T11:53:32+02:00 List-Id: "Jano" a �crit dans le message de news:2ngv8lFnp34U1@uni-berlin.de... > So instead of a single delay you may prefer > > -- Inner loop: > loop > if Dummy'Terminated then > Free (Dummy); > exit; > else > delay 0.01; -- To not hog CPU > end if; > end loop; > If (like me) you don't like busy waiting, you can do the following: begin Dummy.Never_Accepted; exception when Tasking_Error => null; end; Of course, the entry Never_Accepted is never accepted, but the run-time will raise Tasking_Error in waiting tasks when Dummy completes. (Strictly speaking, if you are on a multi-processor or if the waiting task is of higher priority than Dummy, you should still have a loop to wait for the task to terminate, but in this case the busy loop would be presumably executed only once). -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr