SharedStreams (was: [BUG][FIX] SharedQueue flushing (a plea for consideration))

Stephen Pair stephen at pairhome.net
Thu Jun 12 13:34:51 UTC 2003


While we're talking about SharedQueue...I'd like to take this 
opportunity to remind everyone of the SharedStreams package on 
SqueakMap.  I would actually like to see SharedQueue deprecated in favor 
of SharedBufferStream.  SharedBufferStream offers better compatibility 
with the Stream protocols and offers all the functionality (and then 
some) of SharedQueue.  The SharedStreams package also contains a 
SharedBidirectionalStream which can act like a SocketStream (without 
actually using a socket) except that you are not limited to only using 
Character objects in the stream.

- Stephen

Doug Way wrote:

>
> Just a reminder that we should try to add the extra comments in 
> parentheses in the subject when replying so that things show up in the 
> bugfixes archive.  In this case, this is mostly "(a plea for 
> consideration)".  A subject-comment like that showing up in the 
> archive will attract more attention than no comment at all.
>
> Also, I won't generally be able to respond to direct requests to 
> include something, unless it's some sort of emergency.  It is 
> reasonable to re-post about a very old fix in order to bring attention 
> to it, if it's important enough to you, though.  So I'm doing that for 
> Nathanael here. :-)
>
> - Doug Way
>
>
> Stephane Ducasse wrote:
>
>>
>> Begin forwarded message:
>>
>>> From: Nathanael Schärli <n.schaerli at gmx.net>
>>> Date: Wed Jun 11, 2003  10:04:50 AM Europe/Zurich
>>> To: "'Doug Way'" <dway at riskmetrics.com>
>>> Cc: "'Stephane Ducasse'" <ducasse at iam.unibe.ch>
>>> Subject: FW: [BUG][FIX] SharedQueue flushing
>>>
>>> Hi Doug
>>>
>>> I have posted this bugfix just about a year ago, but for some reason it
>>> didn't make it into the image yet. Since it concerns a very central
>>> class of the system, I think that it would be good of you could 
>>> included
>>> it into the updates.
>>>
>>> Thanks,
>>> Nathanael
>>>
>>>> -----Original Message-----
>>>> From: squeak-dev-admin at lists.squeakfoundation.org
>>>> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On
>>>> Behalf Of Nathanael Schärli
>>>> Sent: Dienstag, 18. Juni 2002 11:18
>>>> To: squeak-dev at lists.squeakfoundation.org
>>>> Subject: [BUG][FIX] SharedQueue flushing
>>>>
>>>>
>>>> Hey
>>>>
>>>> I have noticed that there are bugs in the methods
>>>> SharedQueue>>flush and
>>>> SharedQueue>>flushAllSuchThat:. The problem is that both of
>>>> them do not
>>>> properly adjust the semaphore "readSynch" which is used to
>>>> block readers if the queue is empty. Look at the following examples:
>>>>
>>>> q _ SharedQueue new.
>>>> q nextPut: 100.
>>>> q flush.
>>>> q next.
>>>>
>>>> This example should block the active process because there is
>>>> currently no element in the queue. Instead, you get an error
>>>> message ("Error in SharedQueue synchronization").
>>>>
>>>> q _ SharedQueue new.
>>>> q nextPut: 100.
>>>> q nextPut: 200.
>>>> q flushAllSuchThat: [:each | each > 150].
>>>> q next.
>>>> q next.
>>>>
>>>> Also this example should block the active process because
>>>> there is currently no element in the queue. Instead, you get
>>>> the same error message ("Error in SharedQueue synchronization").
>>>>
>>>>
>>>> I have attached a little changeset that fixes this problem.
>>>>
>>>> Cheers,
>>>> Nathanael
>>>



More information about the Squeak-dev mailing list