Will the real sqUnixSocket.c step forward?

Lex Spoon lex at cc.gatech.edu
Wed May 1 04:29:14 UTC 2002


> >So the patch isn't complete. Today we managed to "fumble" ourselves 
> >around it by
> >hacking waitForDataUntil: and doing a "(Delay milliSeconds: 10) 
> >wait" instead of
> >the wait with timeout on the readsemaphore. Yep, ugly as hell but it 
> >works well
> >enough for us to continue developing...
> >

Okay, Ian has patiently explained to me how the semaphore notification
stuff is supposed to work, and it turns out that the SourceForge code is
really a mess.  Basically, the following line in notify():

	  int mask= pss->pendingEvents | eventMask;

would cause all events to be signalled that the image is interested in,
whether the event has happened or not.  Changing the "|" to the proper
"&" (duh!) causes many events *not* to be signalled.  This led to a
cascade of changes to make sure that pendingEvents has all the flags it
is supposed to, and that select() gets called on all the events listed
in pendingEvents.  This is all posted on SourceForge now.

Goran's example code works properly, Scamper works, and with any luck
email sending works.  :)  Hopefully this is better on the whole, but
there may well be new problems.  It's tricky stuff, and the code is less
than clear.

The changes are posted on SourceForge.  I haven't looked at Ian's
version, but there's a good chance that it has similar issues.

Lex Spoon



More information about the Squeak-dev mailing list