[Q] SharedQueue Bug or Feature?

Sungjin Chun chunsj at embian.com
Fri Aug 5 01:35:38 UTC 2005


Thanks for your help. But the problem remains, and I found a  
interesting thing. If I
remove the line for Transcript show:... then the queue has all  
elements correctly.
Now here comes another question: why Transcript show:... line causes  
problem? Or is
this mere coincidence with more fundamental problem?

Thanks in advance.

On Aug 5, 2005, at 12:33 AM, Marcus Denker wrote:

> Hi,
>
> Lex has implemented an alternative implementation for SharedQueue:
> http://bugs.impara.de/view.php?id=1375
>
> Could you test is this privides the correct behavor?
>
>    Marcus
>
>
> Am 04.08.2005 um 16:49 schrieb Sungijn Chun:
>
>
>> Hi,
>>
>> I'm trying to create producer/consumer example using SharedQueue  
>> class.
>> But when I want to fill queue(which is a instance of SharedQueue)  
>> with 2
>> different processes like this:
>>
>> [1 to: 20 do: [ :i |
>> | j |
>> j _ queue nextPut: i.
>> Transcript show: 'Push: ', (i asString), '(', (j asString), ')'; cr
>> ]] fork.
>> [21 to: 40 do: [ :i |
>> | j |
>> j _ queue nextPut: i.
>> Transcript show: 'Push: ', (i asString), '(', (j asString), ')'; cr
>> ]] fork.
>>
>> the queue does not contain entire 40 elements, it just drops some  
>> of them
>> randomly. I think SharedQueue can handle this kind of situation  
>> but I cannot
>> figure out what is my problem. I'm using 3.8 image in windows and  
>> linux.
>>
>> Thanks in advance.
>>
>>
>>
>
>
>




More information about the Squeak-dev mailing list