Received: by 10.224.213.1 with SMTP id gu1mr4626273qab.7.1348264561934; Fri, 21 Sep 2012 14:56:01 -0700 (PDT) Received: by 10.52.156.115 with SMTP id wd19mr1274485vdb.2.1348264561897; Fri, 21 Sep 2012 14:56:01 -0700 (PDT) Path: e10ni4265390qan.0!nntp.google.com!l8no5202933qao.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.scheme Date: Fri, 21 Sep 2012 14:56:01 -0700 (PDT) In-Reply-To: <37906024-3472-4236-9af0-87ce7ca77920@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=129.10.115.151; posting-account=y39Y1woAAACPxID_svBGL-WL70yOJRi8 NNTP-Posting-Host: 129.10.115.151 References: <2eb375e0-ace6-4157-b906-7e6d250ec74d@googlegroups.com> <37906024-3472-4236-9af0-87ce7ca77920@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2e40259e-5065-4e87-b438-a775597d479d@googlegroups.com> Subject: Re: cpu-intensive multithreading From: Sam Tobin-Hochstadt Injection-Date: Fri, 21 Sep 2012 21:56:01 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Friday, September 21, 2012 4:11:24 PM UTC-4, Patrick Useldinger wrote: > On Friday, September 21, 2012 8:39:27 PM UTC+2, Sam Tobin-Hochstadt wrote= : >=20 > > Racket [1] provides facilities for using multiple processors and cores,= in the form of futures [2] and places [3]. >=20 >=20 >=20 > I have had a look at Racket before, but >=20 > 1) threads do not work for me >=20 > 2) futures look a little like black magic (according to the guide, paragr= aph 18.10) and it's hard to predict whether they will really run in paralle= l, or what you can do about it >=20 > 3) places will most likely not permit to share top-level variables (at le= ast in Windows where fork() does not work as in *nix). >=20 >=20 >=20 > Does any of these permit at least read access to global variables? I know= this is not recommended, but in my case it is the easiest solution without= refactoring the whole program. Futures are true shared-memory, and thus support read and write access to a= ll variables. Depending on your application, futures can be very effective= even if they don't guarantee parallelism. Number-crunching is a particula= r strength here -- see this benchmark for an example: https://github.com/pl= t/racket/blob/master/collects/tests/racket/benchmarks/shootout/mandelbrot-f= utures.rkt Sam