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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!newsfeed.datemas.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 12 Nov 2013 13:52:15 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Maximum Number Of Tasks? References: In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <52822462$0$6549$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 12 Nov 2013 13:51:46 CET NNTP-Posting-Host: 39a3e71c.newsspool4.arcor-online.net X-Trace: DXC=`C0En7l54?SI?44J>Z[:RQ4IUKZLh>_cHTX3j]j7``=COBNkQ X-Complaints-To: usenet-abuse@arcor.de Xref: news.eternal-september.org comp.lang.ada:17624 Date: 2013-11-12T13:51:46+01:00 List-Id: On 12.11.13 10:53, FritzVonBraun wrote: > I was wondering about the maximum number of tasks in Ada but I couldnt find > any info. The question is, is a task in Ada technically similar to a thread in > Windows under the hood? Threads are restricted by the stack size that each > thread has reserved, so in practice the maximum number of threads is about 2000. > > The reason I'm asking is that I wonder if Ada provides a more comfortable > solution to the thread pool problem. In C++ for example I create a number of > threads roughly equal to the number of processor cores and then have a number > of Jobs that are distributed over the threads and which implement a time > sharing system by returning control to the thread which then assigns time to > another Job. If you have jobs that do not require intermittent communication among them, then in particular, I'd be sure to have a look at the Paraffin library. http://paraffin.sourceforge.net/ As an example of a different setup, I have seen a program that had the number of tasks be about 4x that of processors; all ran at the "same" time and the number of tasks was suggested by the program's logic, not by either hardware or OS. Load distribution seemed very well handled (GNAT on GNU/Linux in this case), 4 x #CPU was a sweet spot regarding the number of tasks.