[racket-dev] futures waiting for scheme_make_envunbox

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Wed Aug 25 10:41:04 EDT 2010

On Wed, Aug 25, 2010 at 8:07 AM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
> On Wed, Aug 25, 2010 at 9:56 AM, Matthew Flatt <mflatt at 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:
>
> [samth at punge:~/tmp plt] raco decompile mandelbrot.rkt
> hash-ref: no value found for key: 1128

Blake will see if this is a bug fixed in our local changes or
something else he should fix and he'll send you the decompiled result
in either case.

Jay

>
> so it's hard to tell exactly what's happening.
> --
> sam th
> samth at ccs.neu.edu
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the dev mailing list.