org.apache.maven.surefire.util.internal
Class FunkyTwoThreadBlockingQueue
java.lang.Object
org.apache.maven.surefire.util.internal.FunkyTwoThreadBlockingQueue
- All Implemented Interfaces:
- BlockingQueue
public class FunkyTwoThreadBlockingQueue
- extends java.lang.Object
- implements BlockingQueue
A producer/consumer queue that is optimized for *one* producer thread
and *one* consumer thread, and solely optimized for efficient inserts
by the producer, minimizing producer locking for hand-off to
a second consumer.
TwoThreadBlockingQueue insert 5000000 elements in = 52
FunkyTwoThreadBlockingQueue insert 5000000 elements in = 42
TwoThreadBlockingQueue produced and taken 5000000 elements in = 104
LinkedBlockingQueue insert 5000000 elements in = 1815
LinkedBlockingDeque insert 5000000 elements in = 113
ArrayList insert 5000000 elements in = 18
LinkedList insert 5000000 elements in = 334
- Author:
- Kristian Rosenvold
|
Method Summary |
void |
add(java.lang.Object object)
|
void |
put(java.lang.Object object)
|
java.lang.Object |
take()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FunkyTwoThreadBlockingQueue
public FunkyTwoThreadBlockingQueue()
put
public void put(java.lang.Object object)
add
public void add(java.lang.Object object)
- Specified by:
add in interface BlockingQueue
take
public java.lang.Object take()
throws java.lang.InterruptedException
- Specified by:
take in interface BlockingQueue
- Throws:
java.lang.InterruptedException
Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.