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-Thread: 103376,4bd6ca8f7a1eb225 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.0.170 with SMTP id 10mr4925858pbf.2.1322670761016; Wed, 30 Nov 2011 08:32:41 -0800 (PST) Path: lh20ni45339pbb.0!nntp.google.com!news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Class with task destructor Date: Wed, 30 Nov 2011 11:32:40 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <30604696.94.1322013045135.JavaMail.geo-discussion-forums@yqzz20> <24938373.1788.1322615481874.JavaMail.geo-discussion-forums@yqjo5> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1322670760 13031 192.74.137.71 (30 Nov 2011 16:32:40 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 30 Nov 2011 16:32:40 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:ZLZwXc89H8FQBF9nyiPNMKmNSrY= Xref: news1.google.com comp.lang.ada:19267 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: 2011-11-30T11:32:40-05:00 List-Id: Adam Beneschan writes: > On Nov 30, 12:35�am, Simon Wright wrote: >> "Rego, P." writes: >> � �while not T_Ptr.Primary'Terminated loop >> � � � delay 0.001; >> � �end loop; > > Is it just me, or are there others who think that resorting to code > like this is ... well, icky? It's not just you. ;-) Ada should provide a way to wait for an arbitrary task, or a group of tasks, to terminate. Without polling. It's quite tricky to implement, though. Part of the problem with polling is that the delay is almost certainly too long, or too short -- probably both! I recently fixed an efficiency bug in a program that did something like the above polling. There were about 2000 tasks. The program did its job in a few seconds, and then at the end started waiting for all those tasks to terminate, and that took HALF AN HOUR. - Bob