[BUG][FIX] SharedQueue flushing

Stephane Ducasse ducasse at iam.unibe.ch
Wed Jun 11 08:10:54 UTC 2003



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
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FixSharedQueue.1.cs
Type: application/octet-stream
Size: 1262 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030611/5aba28e4/FixSharedQueue.1.obj


More information about the Squeak-dev mailing list