socket synchronization (was "Celeste sending/fetching mail with Michaels refactored clients")

John M McIntosh johnmci at smalltalkconsulting.com
Tue Nov 19 20:00:54 UTC 2002


On Tuesday, November 19, 2002, at 03:13  AM, Andreas.Raab at gmx.de wrote:

> Julian,
>
>> Totally agree.  I don't know the issues in the networking code so I
>> won't presume to say whether it's possible but if it is then this  
>> would
>> be really nice to see.  The mysql postgresql drivers, for example,  
>> have
>> a 500ms delay inserted to make sure they work in Windows.  You can
>> actually reduce it to about 80 (on my machine anyway) but it's still a
>> big pain.
>
> <outcry>
> HOW THE HELL DO YOU EXPECT ME TO FIX THOSE ISSUES IF YOU DON'T REPORT
> THEM???
> </outcry>

One of the problems is related back to the issue that in Windows a  
single semaphore is used to
signify both read/write and control functions. Under the right  
conditions where you have read & writing going
on on in parallel  on a single socket it screws up the assumptions that  
the smalltalk programmer has made because the
read loop for example picks up the write sempahore signal and gets  
confused, then the write logic never completes and run
thru it's timeout logic (if it exists). Also some people have reported  
extraneous signaling were they spin in their
read or write loop consuming sempahore signals which the windows VM  
socket code seems to generate.

As a template you might want to review the unix socket code after Ian  
spent some serious time fixing this class of problems
and reflecting on my thoughts about semaphore signaling and not quite  
agreeing, however that really another refactoring, when he migrating to  
the three semaphore model earlier this year.

Then again migrating to Flow might be easier.

  --
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===




More information about the Squeak-dev mailing list