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,1a44c40a66c293f3 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!news.highwinds-media.com!newspeer1-win.ntli.net!newsfe5-win.ntli.net.POSTED!53ab2750!not-for-mail From: "Dr. Adrian Wrigley" Subject: Re: PAR (Was: Embedded languages based on early Ada) User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.ada References: <1172192349.419694.274670@k78g2000cwa.googlegroups.com> <1172239820.896603.222120@k78g2000cwa.googlegroups.com> <113ls6wugt43q$.cwaeexcj166j$.dlg@40tude.net> <1i3drcyut9aaw.isde6utlv6iq.dlg@40tude.net> <1c61jqeqo68w$.2irtg70stnsa.dlg@40tude.net> <1vdieyr16h7ct$.1vuvfmghy8dzo$.dlg@40tude.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Wed, 07 Mar 2007 19:03:44 GMT NNTP-Posting-Host: 82.21.99.109 X-Trace: newsfe5-win.ntli.net 1173294224 82.21.99.109 (Wed, 07 Mar 2007 19:03:44 GMT) NNTP-Posting-Date: Wed, 07 Mar 2007 19:03:44 GMT Organization: NTL Xref: g2news2.google.com comp.lang.ada:9757 Date: 2007-03-07T19:03:44+00:00 List-Id: On Wed, 07 Mar 2007 18:26:08 +0000, Ray Blaak wrote: > "Dmitry A. Kazakov" writes: >> Hmm, but checking is really the key issue here. I fail to see it in bare >> PAR. It is just absent there. What would be the semantics of: >> >> declare >> I : Integer := 0; >> begin in parallel >> I := I + 1; >> I := I - 1; >> end; -- What is the postcondition here? > > That would be bad programming, just as if you expressed it equivalently with > expicit task bodies. I think the issue is whether this is permitted, and whether compilers can generally give a warning in such cases. I think it's like uninitialised variables - compilers often spot these and warn. There are two problems in this case - reading and writing the same variable in different statements, and writing to the same variable twice. VHDL concurrent assignments can handle this multiple assignment very nicely using signal resolution functions. It would be nice if software parallel constructs could do parallel combination, such as "and"ing many boolean variables together, or computing integer sums efficiently. This would probably best be done by an optimiser spotting specific patterns of use in serial code. Another problem not mentioned is memory allocation. Once you fire off hundreds of threads, memory use may escalate unexpectedly. Holding back some memory intensive threads may help, provided you don't create new threads using up the last available store. -- Adrian