<br><div class="gmail_quote">On Thu, Oct 22, 2009 at 3:10 PM, Nadeem Abdul Hamid <span dir="ltr"><<a href="mailto:nadeem@acm.org">nadeem@acm.org</a>></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've finally figured out that if I uncomment the "sleep" statement, then it does *not* hang. However, that makes performance very sluggish (even though LATENCY is defined as .01). So I'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 "sleep" 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't remember why I used byte-ready? to begin with -- in the morning I'll try without it and see what happens by just letting "read-byte" block until there's data.<br>
</blockquote><div><br>Nadeem, <br><br>byte-ready? shouldn't "lock" 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>