[squeak-dev] Resuming a SocketStream after a ConnectionClosed exception?

Göran Krampe goran at krampe.se
Thu Feb 16 11:54:19 UTC 2017


On 15/02/17 22:34, tim Rowledge wrote:
> Hi Göran!
>
>> On 15-02-2017, at 3:50 AM, Göran Krampe <goran at krampe.se> wrote:
>>
>
>> 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.
>
> A single process to write and another to read, both at same priority
> so only one can be  doing stuff at once.

Mmmm, those two will not preempt each other - but other processes with 
higher prio preempt them (right?), so perhaps I am daft but doesn't that 
mean they will switch anyway (potentially in the middle of a method etc)?

regards, Göran


More information about the Squeak-dev mailing list