<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16421"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=504453208-17052011><FONT size=2
face="Courier New">Thanks, I patiently await the fix. I am not in a hurry.
Thanks for keeping me posted, Jos</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> users-bounces@racket-lang.org
[mailto:users-bounces@racket-lang.org] <B>On Behalf Of </B>James
Swaine<BR><B>Sent:</B> 17 May 2011 07:02<BR><B>To:</B>
users@racket-lang.org<BR><B>Subject:</B> Re: [racket] future on dual processor
machine<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=gmail_quote>
<DIV>It looks like you've found a futures bug. This is being caused by
the interaction between futures and custodians (which DrRacket is using) --
we've identified a fix, but need a little more testing to ensure that it's
working properly. I will keep you posted here. </DIV>
<DIV><BR></DIV>
<DIV>-James </DIV>
<DIV><BR></DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>The program below has strange behaviour:<BR>I run it from
DrScheme on a dual core machine with two processors.<BR>No other
applications active.<BR>When I run it the first time it uses 100% of both
processors.<BR>Running it again without leaving DrScheme, it apparently uses
one processor<BR>at a time only, although switching frequently. CPU usage
histories mirror<BR>each other. How come only one processor is used at a
time during the second<BR>run?<BR>Leaving DrScheme, restarting DrScheme and
running again gives me 100% of<BR>both processors again.<BR>In all runs
processor-count returns 2.<BR>Thanks, Jos<BR><BR>DrRacket, version
5.1.1.5--2011-05-09(b74c9f9/a) [3m].<BR>Windows 7.<BR>Intel Pentium dual
core CPU E6500.<BR><BR>#lang racket<BR>; check that both processors are used
by means of<BR>; windows tool for measurement of CPU usage.<BR>(require
racket/unsafe/ops)<BR>(require racket/fixnum)<BR>(require
racket/future)<BR>(collect-garbage)<BR>(processor-count) ; ->
2<BR>(define N/2 #e1e8)<BR>(define N (* 2 N/2))<BR>(define V (make-fxvector
N))<BR>(define (set-V! f r) (unsafe-fxvector-set! V f r))<BR><BR>(define
(task1)<BR> (for ((i (in-range 50)))<BR> (for ((k (in-range 0
N/2))) (set-V! k k))))<BR><BR>(define (task2)<BR> (for ((i (in-range
50)))<BR> (for ((k (in-range N/2 N))) (set-V! k k))))<BR><BR>; task1
fills the first half of vector V.<BR>; task2 the second half.<BR>; In both
tasks the ((i (in-range 50))) is inserted in order to<BR>; force the program
to run long enough to see its parallel effects.<BR><BR>(define f (future
task1))<BR>(task2)<BR>(touch f)<BR>; Clear memory avoiding memory overflow
during next run.<BR>(set! V #f)<BR>(set! f
#f)<BR>(collect-garbage)<BR><BR><BR><BR><BR>-------------- next part
--------------<BR>An HTML attachment was scrubbed...<BR>URL: <<A
href="http://lists.racket-lang.org/users/archive/attachments/20110516/4edbda6f/attachment-0001.html"
target=_blank>http://lists.racket-lang.org/users/archive/attachments/20110516/4edbda6f/attachment-0001.html</A>><BR><BR>End
of users Digest, Vol 69, Issue
45<BR>*************************************<BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>