[racket] Using future and touch

From: Joe Gilray (jgilray at gmail.com)
Date: Thu Jul 25 11:11:55 EDT 2013

Thanks for your help James.  Let me know what you learn.  I will try to
rewrite those routines.  As indicated for (square? ) I will need to make a
table which will slow things down further :-(

About typed racket: my goal is to learn, so I have played with typed racket
but didn't get very far (maybe I was overly ambitious, trying to covert
some code that really didn't want to be converted).  I will try that as
well.  I would like to be able to use threads with racket as I've found
them useful in other environments.

Tim, I think places seems like overkill for this, but thanks for your work
and the reminder about PE problems (Doh!).

-Joe


On Thu, Jul 25, 2013 at 7:51 AM, James Swaine <
james.swaine at eecs.northwestern.edu> wrote:

> 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.
>
> -James
>
>
>> 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
>>
>>
>
> ____________________
>   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/20130725/2af1cbe2/attachment.html>

Posted on the users mailing list.