<div dir="ltr">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 :-(<div><br></div>
<div>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.</div>
<div><br></div><div>Tim, I think places seems like overkill for this, but thanks for your work and the reminder about PE problems (Doh!).</div><div><br></div><div>-Joe</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Jul 25, 2013 at 7:51 AM, James Swaine <span dir="ltr"><<a href="mailto:james.swaine@eecs.northwestern.edu" target="_blank">james.swaine@eecs.northwestern.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>Unfortunately, it is still rather easy to stumble upon a primitive which unexpectedly blocks futures. </div><div><br></div><div>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.</div>
<div><br></div><div>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. </div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>-James</div></font></span><div class="im"><div><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Wed, Jul 24, 2013 at 11:34 PM, Joe Gilray <<a href="mailto:jgilray@gmail.com" target="_blank">jgilray@gmail.com</a>> wrote:<br>
<br>
> So I should write my own (gcd ) and (square? ) functions?<br>
><br>
> I can try that, but isn't there a simple way to use threads?<br>
><br>
> Thanks,<br>
> -Joe<br><br>
</blockquote></div><br></div></div></div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>