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,1c8c283347cf0236 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!newsfeed-fusi2.netcologne.de!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 23 Apr 2011 11:55:56 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: If not Ada, what else... References: <87r58vmmo0.fsf@mid.deneb.enyo.de> <64e02334-d9cf-498c-8870-7b574533cdeb@i39g2000prd.googlegroups.com> <3bd4r61fto439q8a1qf78gsllar1pmkqtv@4ax.com> In-Reply-To: <3bd4r61fto439q8a1qf78gsllar1pmkqtv@4ax.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4db2a22c$0$6990$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 23 Apr 2011 11:55:56 CEST NNTP-Posting-Host: 356ff27d.newsspool4.arcor-online.net X-Trace: DXC=hdW94;RfiY6;]cDoEWD6A44IUKejV8e[0_KkfSTL4H:;iDS:aW59 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:19007 Date: 2011-04-23T11:55:56+02:00 List-Id: On 4/23/11 4:20 AM, Peter C. Chapin wrote: > // This method operates on a sequence of type T. > def someMethod[T](data: Seq[T]) = { > for (item<- data par) { > // Parallelized loop. Iterations are spread over multiple cores. > } > } > > In the above code 'par' is actually a method being applied to 'data.' The > for loop ends up being parallelized not because the compiler treats it in a > special way, but rather because of the behavior of the 'par' method. Would 'par' be a normal method or would the programmer make sure that it operates nicely in parallel, e.g. does not mess with "shared" variables?