On Wed, Aug 25, 2010 at 9:56 AM, Matthew Flatt <mfl...@cs.utah.edu> wrote:
> At Wed, 25 Aug 2010 09:42:40 -0400, Sam Tobin-Hochstadt wrote:
>> While trying to use futures to parallelize a simple piece of code, I
>> was able to remove all of the waiting except for this:
>>
>> future: 3 waiting for runtime at 1282743524205.783936: [scheme_make_envunbox]
>>
>> which happens continuously.  What causes this function to be invoked,
>> and how can I eliminate it?
>
> It happens when initializing a local variable that is assigned via
> `set!'. Probably we should inline scheme_make_envunbox() in
> JIT-generated code.

Ok, that's kind of surprising.  It seems that Typed Racket's optimizer
is transforming the program in such a way that the bytecode compiler
inserts `set!' where it wasn't before.  I've attached the relevant
file (which is just TR applied to the mandlebrot example from the
futures paper).  When the #:optimize keyword is used, the futures wait
on `scheme_make_envunbox'.  When it isn't used, there's much less
waiting (just allocation and jitting).

Unfortunately, trying to decompile this file produces an error in the
decompiler:

[sa...@punge:~/tmp plt] raco decompile mandelbrot.rkt
hash-ref: no value found for key: 1128

so it's hard to tell exactly what's happening.
-- 
sam th
sa...@ccs.neu.edu

Attachment: mandelbrot.rkt
Description: Binary data

_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Reply via email to