replace ConcurrentLinkedQueue with single-linked list for Mailbox.systemQueue

cost zero when empty, non-blocking, shave off 84 bytes per actor
This commit is contained in:
Roland 2011-10-18 18:06:17 +02:00
parent 01efcd7b50
commit 5c823ad50d
5 changed files with 116 additions and 41 deletions

View file

@ -5,8 +5,14 @@
package akka.dispatch;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
abstract class AbstractMailbox {
private volatile int _status; // not initialized because this is faster: 0 == Open
protected final static AtomicIntegerFieldUpdater<AbstractMailbox> updater = AtomicIntegerFieldUpdater.newUpdater(AbstractMailbox.class, "_status");
protected final static AtomicIntegerFieldUpdater<AbstractMailbox> updater =
AtomicIntegerFieldUpdater.newUpdater(AbstractMailbox.class, "_status");
private volatile SystemMessage _systemQueue; // not initialized because this is faster
protected final static AtomicReferenceFieldUpdater<AbstractMailbox, SystemMessage> systemQueueUpdater =
AtomicReferenceFieldUpdater.newUpdater(AbstractMailbox.class, SystemMessage.class, "_systemQueue");
}