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,292c095d622af1d0 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.231.2 with SMTP id tc2mr898040pbc.8.1336616441316; Wed, 09 May 2012 19:20:41 -0700 (PDT) MIME-Version: 1.0 Path: pr3ni8297pbb.0!nntp.google.com!news1.google.com!news.glorb.com!news.ecp.fr!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: basic question on Ada tasks and running on different cores Date: Wed, 9 May 2012 21:20:11 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <30585369.219.1336470732142.JavaMail.geo-discussion-forums@ynbq3> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1336616431 10686 69.95.181.76 (10 May 2012 02:20:31 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 10 May 2012 02:20:31 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-05-09T21:20:11-05:00 List-Id: wrote in message news:jodnse$c29$1@speranza.aioe.org... >I am talking about standard languages aka all languages including Ada. Ada always has supported parallelism. I think you are confused by various research languages that are trying to *automatically* make programs execute in parallel. It's not surprising that these disappear, people have been trying to design these since the 1960s (some of the research papers I read while in college - in the 1970s - were ancient even then). My personal opinion is that these "holy grail" languages will never really work out. If a reasonably sensible solution existed, someone would have found it in the last 50 years of looking. I'm sure some progress will be made, but only by increasing non-determinism elsewhere in the language -- which will make debugging (and thus the languages) impractical. People that are looking for research grants have a lot of advantage to spreading FUD about what is and is not possible, so be careful about depending on them. OTOH, *manual* parallelism, as exhibited by Ada's tasks, threads in Windows and Linux, and constructs in many other languages, works and has been in use for decades. (Ada makes no claim to having invented that.) To claim otherwise is just plain wrong. And you don't have to take my word for it. You can see it yourself. You can download the very useful Process Explorer tool for Windows, which lets you see what each process on your computer is doing. Install it on any modern Windows system. Then compile a program that uses a number of CPU-intensive tasks with most Windows Ada compilers (any that claim to use threads, I know that GNAT, ObjectAda, and IBM's Ada all do from personal experience). I'm sure someone else here could recommend a short Ada program. If you run such a compiled Ada program and examine the process with Process Explorer on a multicore machine, you'll see that several or all of the cores will be in use for that single process. (Yes, I've done this on Windows XP. Supposely, Windows 7 is better at it but I haven't tested that myself.) Typically, more CPU than a single core could use will be consumed by the program. That means that the core are running the tasks *in parallel*, because they obviously aren't being run sequentially and there is no other choice. I suppose Microsoft could be lying about the parallel execution evidenced by this commonly used tool, but I have no idea what gain that would have for Microsoft. Anyway, do the experiment with an appropriate program (just make sure that the program doesn't require sequential execution). See if you still think that Ada programs can't run parallel threads. Randy.