Getting Squeak to stop hanging on file I/O (and to start blocking threads on serial)?
David T. Lewis
lewis at mail.msen.com
Sat Apr 13 21:59:16 UTC 2002
On Sat, Apr 13, 2002 at 11:47:34AM -0700, Ned Konz wrote:
> On Saturday 13 April 2002 11:11 am, David T. Lewis wrote:
> > That's similar to what I'm doing. Start a Win32 thread that does a
> > read, then Interpreter>>signalSemaphoreWithIndex when the read
> > completes.
> As long as you don't call the interpreter from your non-main thread,
> that sounds like it should work.
I'm calling #signalSemaphoreWithIndex: from the non-main thread, and
that probably is the problem. But I have not yet thought of a way around
this. The thread that waits on the read to complete is the one that
needs to tell Squeak that the read has completed, but it presumably needs
to be able to signal a Squeak semaphore as an atomic operation without
being interrupted by the Windows scheduler. Otherwise, I imagine that
it's possible for Squeak to go off and do an garbage collect right in
the middle of a #signalSemaphoreWithIndex, which would probably not
be a good thing.
> > It works, but it's complicated and (pending further
> > debugging) unreliable. Debugging it frequently consists of turning
> > off the computer, rebooting, and trying something different. Grump.
> Are you using NT? That sounds more like Win9x to me...
Right, Windows ME. Thankfully I've booted back into Linux now, so my
mood has improved considerably. :))
More information about the Squeak-dev