[squeak-dev] Re: HydraStream implementation , pull or push scheme?
Stephan Rudlof
sr at evolgo.de
Mon Feb 25 18:46:40 UTC 2008
On 25.02.2008 15:31, Paolo Bonzini wrote:
>
>> when user writes to stream, stream is just collecting a data. Flushing
>> stream not causing data being sent. A sender may block when it's
>> cache is full, and will unblock only when receiving side will confirm
>> that it's received packets, which now can be discarded from write
>> cache buffer.
>> Data is sent only when remote side places request on receiving next
>> packet.
>> So, when user calls #read, a receiving side sends 'request next data
>> packet #N' and when it's received, returns from method.
>
> Pull is usually much better.
Why?
What if the user does not await data, but there may be some some time (asynchronous communication)?
>
> I used push for GNU Smalltalk's TCP sockets and in retrospect it was not
> a great idea).
What have been the problems?
Regards,
Stephan
>
> Paolo
>
>
--
Stephan Rudlof (sr at evolgo.de)
"Genius doesn't work on an assembly line basis.
You can't simply say, 'Today I will be brilliant.'"
-- Kirk, "The Ultimate Computer", stardate 4731.3
More information about the Squeak-dev
mailing list
|