Last updated at 1:46 pm UTC on 15 February 2017
Göran Krampe Wed, Feb 15, 2017 at 12:50 PM
Reply-To: The general-purpose Squeak developers list
On 14/02/17 03:27, tim Rowledge wrote:
All in all I’m not at all sure that having two forked processes
working with the same socket stream is the best way to do this but it
seems to work tolerably for now. Might it be better to have the
socket reading process at a higher priority? I can’t think of a way
to merge the two, which might be a better technique.
I wrote the current incarnation of SocketStream and I intentionally did not add any semaphore/mutex for protections. And yes, the SocketStream has internal state to know positions in buffers etc etc - so NO, you should not use two Processes with the same SocketStream.
Having said that... if you have one process only writing and one only reading - you may get away with it - IIRC (no promises) the inBuffer and outBuffer (and associated ivars) may be 100% separated.