This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.locks.AbstractQueuedSynchronizer; | |
public class CountingLatch | |
{ | |
/** | |
* Synchronization control for CountingLatch. | |
* Uses AQS state to represent count. | |
*/ | |
private static final class Sync extends AbstractQueuedSynchronizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.*; | |
import akka.cluster.Cluster; | |
import akka.event.*; | |
import akka.japi.Creator; | |
import com.typesafe.config.ConfigFactory; | |
import java.util.concurrent.CountDownLatch; | |
import static akka.cluster.ClusterEvent.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorRef; | |
import akka.dispatch.Envelope; | |
import akka.dispatch.MessageQueue; | |
import akka.dispatch.UnboundedMessageQueueSemantics; | |
import org.jctools.queues.MpscChunkedArrayQueue; | |
import org.jctools.util.Pow2; | |
public final class MpscChunkedMailbox implements MessageQueue, UnboundedMessageQueueSemantics { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sun.misc.Unsafe; | |
import java.lang.reflect.Field; | |
public class LazySetLong { | |
static final Unsafe unsafe; | |
static final long valueOffset; | |
volatile long o; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorRef; | |
import akka.dispatch.*; | |
import akka.event.*; | |
import org.jctools.queues.MpscArrayQueue; | |
/** | |
* A non-blocking, multiple producer, single consumer high performance logger mailbox. | |
*/ | |
public final class LoggerMailbox implements MessageQueue, LoggerMessageQueueSemantics { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorRef; | |
import akka.dispatch.*; | |
import org.jctools.queues.MpscArrayQueue; | |
/** | |
* Non-blocking, multiple producer, single consumer high performance bounded message queue, | |
* this implementation is similar but simpler than LMAX disruptor. | |
*/ | |
public final class MpscBoundedMailbox implements MessageQueue { |