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: a07f3367d7,99210dd26e04d959 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Loops and parallel execution Date: Wed, 26 Jan 2011 15:57:12 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <4d3eeef7$0$6879$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1296079035 19305 69.95.181.76 (26 Jan 2011 21:57:15 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 26 Jan 2011 21:57:15 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-RFC2646: Format=Flowed; Original Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feed.ac-versailles.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail Xref: g2news2.google.com comp.lang.ada:17691 Date: 2011-01-26T15:57:12-06:00 List-Id: "Georg Bauhaus" wrote in message news:4d3eeef7$0$6879$9b4e6d93@newsspool2.arcor-online.net... ... > Can this be borrowed from HPF (IIUC)? > Is pragma Pure (P) sufficient to signal reentrance? I've thought about such an idea. But it requires restrictions well beyond those enforced by pragma Pure. For instance, Pure packages can write dereferences of pointers to keep global state. Moreover, there can't be any "cheating", which is common in pragma Pure packages. So there would need to be a new kind of categorization for this. I was hoping that we could using the proposed global in/global out categorizations to do the job, but those got dropped from Ada 2012. Also, I think that "no communication" is impractical in most real applications. But it is sufficient if the communication is tightly limited (via atomic and protected objects, and/or synchronized interfaces - you'll need to access global data, just safely). That's another reason why "checked global in/global out" is needed. Finally, like Dmitry, I'm skeptical about fine-grained parallelism buying much. Unless there is specific architectural support (something that doesn't exist in commonly used processors -- and especially in commonly used target OSes/RTOSes), the management overhead will kill any savings on "small" expressions. Thread creation is not cheap! The "win" is on larger tasks - which means that subprograms - and separately compiled subprograms - have to be involved in some way. My main interest in this technology is to make it much easier to create programs that use threads but don't deadlock, livelock, or have dangerous use of globals. That seems to require restrictions on what you can do, and definitely requires some form of compile-time checking to enforce those restrictions. If done usefully, that could be a giant win, as you could use sequential reasoning for the majority of your programming and debugging, and still get parallelism when useful. Randy.