avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Royal <pro...@managingpartners.com>
Subject DefaultQueue not really threadsafe?
Date Mon, 04 Mar 2002 17:23:47 GMT
I've been using the DefaultQueue from Excalibur 4.1 in a small pipeline-based 
project here. Although the javadocs state that its thread safe, I think 
there's a bug somewhere. Check out these numbers:

Default queue:

Statistics:
        Source: [read: 21196]
        Connector: [read: 4868, write: 4868]
        Destination: [write: 3871]

Statistics:
        Source: [read: 21196]
        Connector: [read: 4868, write: 4867]
        Destination: [write: 3870]

Statistics:
        Source: [read: 21196]
        Connector: [read: 4868, write: 4868]
        Destination: [write: 2846]

Statistics:
        Source: [read: 21196]
        Connector: [read: 5062, write: 5062]
        Destination: [write: 3040]

Statistics:
        Source: [read: 21196]
        Connector: [read: 9159, write: 9159]
        Destination: [write: 5088]

Statistics:
        Source: [read: 21196]
        Connector: [read: 13061, write: 13061]
        Destination: [write: 8990]

LinkedListQueue (attached):

Statistics:
        Source: [read: 21196]
        Connector: [read: 21196, write: 21195]
        Destination: [write: 21195]

The off-by-one between the read/write in the connector is due to an element 
that doesn't pass it. That element doesn't make it to the connector each time!

My setup is that I have 3 threads going, with a queue between each (2 
queues). There is a sizeable number of elements being dropped in each stage. 

The LinkedListQueue is definitly much slower, ~6min versus ~1m for the 
DefaultQueue.

I'm curious as to other's experiences with the DefaultQueue in a threaded 
environment.
-pete

-- 
peter royal -> proyal@managingpartners.com

Mime
View raw message