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,10d1a90a699d6cfc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.swip.net!swipnet!nntpserver.swip.net!not-for-mail Message-ID: <462688E3.6050105@nowhere.com> From: Leif Holmgren User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: sv, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada tasking question References: <20070418201307.18a85fd9@cube.tz.axivion.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 18 Apr 2007 23:08:51 +0200 NNTP-Posting-Host: 213.101.94.180 X-Complaints-To: news-abuse@swip.net X-Trace: nntpserver.swip.net 1176930568 213.101.94.180 (Wed, 18 Apr 2007 23:09:28 CEST) NNTP-Posting-Date: Wed, 18 Apr 2007 23:09:28 CEST Organization: A Customer of Tele2 Xref: g2news1.google.com comp.lang.ada:15104 Date: 2007-04-18T23:08:51+02:00 List-Id: Randy Brukardt wrote: > "Stefan Bellon" wrote in message >> >>Starting N tasks, then waiting for them to get all finished and only >>then starting the next N tasks is not difficult. ... > and an array of worker > tasks, and then you can easy vary N to any value you want to try. If my memory does not fail me the advice to use an array here is double good. First of all you don't need to bother with the nitty gritty details of dynamic allocation yourself. Secondly and perhaps most important Ada will handle the synchronization of task termination for you automatically. It will not allow the array to go out of scope before all the tasks are completed. Years ago I implemented such a system (using dynamically allocated tasks) and it worked very well. By doing as suggested you will gain maximum performance even if the buckets take different time to process. /Leif