[racket] values primitive blocks future execution

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Feb 21 16:25:54 EST 2013

Well, just a quick look at the screenshot: I think pair? will block only
when it used in a higher-order way, ie:

  (define (f g) (g 17))
  (f pair?)

instead of:

  (pair? 17)

or, for that matter:

  (define (f g) (g 17))
  (g (lambda (x) (pair? x)))

Robby


On Thu, Feb 21, 2013 at 3:03 PM, Dmitry Cherkassov <dcherkassov at gmail.com>wrote:

> Hi list.
> I've been doing a simple ray tracer[1] and decided to parallelize it using
> futures.
>
> I've tried to use flonums everywhere and added (in-range) to loops [3]
> (over x and y coordinates).
>
> The problem is that execution of future is blocked seriously.
> (apparently by the value primitive) [2]
>
> Are there any ideas why it doesn't work?
>
> I use racket v5.3.3.
>
> [1] Complete source code: http://pastebin.com/EGSzR1Tv
>
> [2] Future visualizer screenshot: http://ompldr.org/vaGpiaQ
>     Invoked via
>     (require future-visualizer)
>     (visualize-futures (run-no-render))
>
> [3] Source code for main loop:
> (define (render-scene-dummy object-list)
>   (let* ([f (future
>            (lambda ()
>              (for* ([x (in-range (/ screen-width 2))]
>                     [y (in-range screen-height)])
>                (let* ([ray-res (ray-cast x y object-list)]
>                       [pix-col (point-col (int-res-p ray-res))])
>                  #t))
>              ))])
>
>     (for* ([x (in-range (/ screen-width 2) screen-width)]
>            [y (in-range screen-height)])
>       (let* ([ray-res (ray-cast x y object-list)]
>              [pix-col (point-col (int-res-p ray-res))])
>         #t))
>     (touch f)))
>
>
>
> --
> With best regards,
> Dmitry
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130221/f32590ca/attachment.html>

Posted on the users mailing list.