Squeak, NT, CGI and Microsofts web server?

John M McIntosh johnmci at smalltalkconsulting.com
Sat Jun 17 18:12:05 UTC 2000


on 6/17/00 4:18 AM, Stefan Matthias Aust at sma at 3plus4.de wrote:

> Probably not with a default Squeak.  I haven't tested but I think I read
> something like that socket requests are serialized because the VM can't
> deal with multiple simultaneous request.  Or perhaps that's only true for a
> Mac?
> 

On the mac this is no longer true, the new OT socket code does most things
at the interrupt level. In testing I had as much as 150 incoming socket
accepts pending. Technically each of these had been accepted at the tcp/ip
level and were waiting for Squeak to confirm the accept or disconnect (of
course we wanted to accept them).

The same applies for reading, incoming data is of course queued at the
socket level, but at some 'magical' point based on socket buffer usage and
thresholds etc etc it notifies the application that data has arrived via an
interrupt, you can of course fiddle with these thresholds using  socket
options if you dare. As mentioned at some point we get an interrupt from the
OS and we read the data into some statically allocated buffers and signal
the read semaphore if required. Later when Squeak gets around to reading the
data, we of course just copy data out of the buffer into the supplied
Smalltalk string and put the buffer back on a free queue.


Note one of the interesting things here is what if the statically allocated
buffers are exhausted. At this point by not handling the read interrupt it
causes the invocation of tcp/ip flow control, and we also signal we have
data. Later when Squeak wakes up we read data from the socket directly into
the Squeak string. At some point we hope the buffers will be freed and go
back to normal processing. This logic prevents all work from stopping.

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Custom Macintosh programming & various Smalltalk dialects
PGP Key: DSS/Diff/46FC3BE6
Fingerprint=B22F 7D67 92B7 5D52 72D7  E94A EE69 2D21 46FC 3BE6
===========================================================================





More information about the Squeak-dev mailing list