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!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 23 Apr 2011 06:17:06 -0500 From: Peter C. Chapin Newsgroups: comp.lang.ada Subject: Re: If not Ada, what else... Date: Sat, 23 Apr 2011 07:17:01 -0400 Organization: Vermont Technical College Message-ID: <75d5r690jlogen6jqnp0m9nf07nbbb12a8@4ax.com> References: <87r58vmmo0.fsf@mid.deneb.enyo.de> <64e02334-d9cf-498c-8870-7b574533cdeb@i39g2000prd.googlegroups.com> <3bd4r61fto439q8a1qf78gsllar1pmkqtv@4ax.com> <4db2a22c$0$6990$9b4e6d93@newsspool4.arcor-online.net> X-Newsreader: Forte Agent 6.00/32.1186 trialware MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-OhCJSdBhsWB1gphX96ndSksVLOiWsgOtBr8xwX5j4Kg/qtJ1P4EjnU8SU4t7rgwJin4xbNgm5Iug3jS!YLoA3MHQrIuP2cH6pG7JNcjQxCOly+7QVj9ecQecBw/clpE/4trdBiVo20DEKjmEVMYXJsQ= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2265 Xref: g2news1.google.com comp.lang.ada:19009 Date: 2011-04-23T07:17:01-04:00 List-Id: On Sat, 23 Apr 2011 11:55:56 +0200, Georg Bauhaus wrote: >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? 'par' is a method provided by the collections library. The programmer is responsible for making sure the loop body is parallel-safe. Peter