[racket] Using future and touch

From: James Swaine (james.swaine at eecs.northwestern.edu)
Date: Thu Jul 25 10:51:46 EDT 2013

Unfortunately, it is still rather easy to stumble upon a primitive which
unexpectedly blocks futures.

Are you familiar with Typed Racket?  Switching to typed can give you
performance improvements even in sequential programs.  In futures programs,
TR can help you avoid blocks because it uses its extra type information to
generate code that uses fast-path primitives wherever possible.  I'm
experimenting with this now on your example, so I'll follow up and let you
know what I find out.

That being said, it's possible that there's some function call in the
hottest part of your loop which still blocks -- in that case, yes, the only
real short-term option is to write your own version of it, unfortunately.


> On Wed, Jul 24, 2013 at 11:34 PM, Joe Gilray <jgilray at gmail.com> wrote:
> > So I should write my own (gcd   ) and (square?   ) functions?
> >
> > I can try that, but isn't there a simple way to use threads?
> >
> > Thanks,
> > -Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130725/1c970d17/attachment.html>

Posted on the users mailing list.