avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Royal <pro...@managingpartners.com>
Subject Re: DefaultQueue not really threadsafe?
Date Mon, 04 Mar 2002 19:10:10 GMT
On Monday 04 March 2002 01:58 pm, Leo Sutic wrote:
> 1) Can you put some code in DefaultQueue and see if it actually enqueues
> the right number of elements? Just after every m_elements.add, put a
> elementsAdded++.
>    Just to figure out just where the elements disappear.

They all enqueue properly

> 2) Can you run the threads one at a time? That is, run thread 1. The queue
> fills up.
>    Run thread 2. Wait until all elements are processed and the second queue
> is full.
>    Run thread 3.

Works fine.

> I just want to see if it really is a threading error or if it is a logic
> error.
> As far as I can see, all methods in DefaultQueue are correctly synchronized
> (with the exceptions I've told you), and I could not find any errors in the
> VariableSizeBuffer.

I've attached my updated QueueTest, you can comment out a line in main() to 
control whether it runs threaded or not. I've also attached my modified 
DefaultQueue with the counters.
-pete

-- 
peter royal -> proyal@managingpartners.com

Mime
View raw message