<br><div class="gmail_quote">On Thu, Oct 22, 2009 at 3:10 PM, Nadeem Abdul Hamid <span dir="ltr">&lt;<a href="mailto:nadeem@acm.org">nadeem@acm.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
First, everything works fine beautifully on Mac OS X. Then I went to try this on Windows XP (using PLT Scheme 4.2.2) and it would hang in this function. I&#39;ve finally figured out that if I uncomment the &quot;sleep&quot; statement, then it does *not* hang. However, that makes performance very sluggish (even though LATENCY is defined as .01). So I&#39;m wondering if without the sleep there is some sort of deadlock happening with the byte-ready? function? I suppose I could keep a counter and only &quot;sleep&quot; every 100 or 1000 failures of the byte-ready? condition, but does anyone have suggestions for a better way to do this? To tell the truth, I don&#39;t remember why I used byte-ready? to begin with -- in the morning I&#39;ll try without it and see what happens by just letting &quot;read-byte&quot; block until there&#39;s data.<br>
</blockquote><div><br>Nadeem, <br><br>byte-ready? shouldn&#39;t &quot;lock&quot; with anything - if there are nothing to be read in the port it returns immediately.  Could the hanging be that there are no data coming through the port?  Because in that case your code (with sleep commented out) will be run in a tight loop, which can appear as hanging. <br>
<br>I tested your function with a string port with plenty of data on WinXP and it works.  <br><br>Cheers,<br>yc<br><br></div></div>