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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,59c52143b2a1463b,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!novia!transit4.readnews.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Date: Sun, 11 Jul 2010 20:47:41 -0400 From: "Peter C. Chapin" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.4) Gecko/20100608 Lightning/1.0b2 Thunderbird/3.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: How many hardware threads? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4c3a65d7$0$2405$4d3efbfe@news.sover.net> Organization: SoVerNet (sover.net) NNTP-Posting-Host: c800cb98.news.sover.net X-Trace: DXC=i[AMB__EDZ;TkVe4FPDeU7K6_LM2JZB_3c>ZAR As we all know there is currently a lot of "buzz" about parallel programming and about the "crisis in software development" that is associated with it. People using languages with weak support for concurrency are now wondering how they will use multi-core systems effectively and reliably. Of course Ada already has decent support for concurrency so part of the problem is solved for those of us using Ada. But not all of the problem... I see a couple of difficulties with writing effective parallel programs for "ordinary" applications (that is, applications that are not embarrassingly parallel). One difficulty is load balancing: how can one decompose a problem to keep all processors reasonably busy? The other difficulty is scalability: how can one design a single program that can use 2, 4, 16, 128, or more processors effectively without knowing ahead of time exactly how many processors there will be? I'm not an expert in Ada tasking but it seems like these questions are as big a problem for Ada as they are for any other language environment. I'm not looking for a solution to all tasking problems here. But there is one feature that seems like a necessary prerequisite to such a solution. The language (or its standard library) needs to provide a portable way for the program to determine how many hardware threads are available. I'm about to write a simple program that decomposes into parallel, compute-bound tasks quite nicely. How many such tasks should I create? I could ask the user to provide the number as a command line argument or in a configuration file. Yet it seems like the program should just be able to figure it out. Does Ada have a standard way of doing that? I didn't see anything in my (admittedly short) review. Thanks! Peter