本文整理汇总了Java中com.conversantmedia.util.concurrent.SpinPolicy类的典型用法代码示例。如果您正苦于以下问题:Java SpinPolicy类的具体用法?Java SpinPolicy怎么用?Java SpinPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpinPolicy类属于com.conversantmedia.util.concurrent包,在下文中一共展示了SpinPolicy类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import com.conversantmedia.util.concurrent.SpinPolicy; //导入依赖的package包/类
@Setup
public void setup() {
executor = Executors.newSingleThreadExecutor();
msgQueue = new PushPullBlockingQueue<>(Run.QUEUE_SIZE, SpinPolicy.SPINNING);
}
示例2: setup
import com.conversantmedia.util.concurrent.SpinPolicy; //导入依赖的package包/类
@Setup
public void setup() {
executor = Executors.newFixedThreadPool(2*Run.MULTITHREAD);
msgQueue = new MPMCBlockingQueue<Long>(Run.QUEUE_SIZE, SpinPolicy.SPINNING);
}
示例3: setup
import com.conversantmedia.util.concurrent.SpinPolicy; //导入依赖的package包/类
@Setup
public void setup() {
executor = Executors.newFixedThreadPool(2*Run.MULTITHREAD);
msgQueue = new DisruptorBlockingQueue<>(Run.QUEUE_SIZE, SpinPolicy.SPINNING);
}
示例4: getCpuSpinPolicyForWaitingInBuffer
import com.conversantmedia.util.concurrent.SpinPolicy; //导入依赖的package包/类
public SpinPolicy getCpuSpinPolicyForWaitingInBuffer()
{
return cpuSpinPolicyForWaitingInBuffer;
}
示例5: setCpuSpinPolicyForWaitingInBuffer
import com.conversantmedia.util.concurrent.SpinPolicy; //导入依赖的package包/类
public void setCpuSpinPolicyForWaitingInBuffer(SpinPolicy cpuSpinPolicyForWaitingInBuffer)
{
this.cpuSpinPolicyForWaitingInBuffer = cpuSpinPolicyForWaitingInBuffer;
}
示例6: DisruptorBlockingQueueFactory
import com.conversantmedia.util.concurrent.SpinPolicy; //导入依赖的package包/类
private DisruptorBlockingQueueFactory(final SpinPolicy spinPolicy) {
this.spinPolicy = spinPolicy;
}
示例7: createFactory
import com.conversantmedia.util.concurrent.SpinPolicy; //导入依赖的package包/类
@PluginFactory
public static <E> DisruptorBlockingQueueFactory<E> createFactory(
@PluginAttribute(value = "SpinPolicy", defaultString = "WAITING") final SpinPolicy spinPolicy
) {
return new DisruptorBlockingQueueFactory<>(spinPolicy);
}
示例8: createQueue
import com.conversantmedia.util.concurrent.SpinPolicy; //导入依赖的package包/类
@Override
BlockingQueue<String> createQueue(final int capacity) {
return DisruptorBlockingQueueFactory.<String>createFactory(SpinPolicy.SPINNING).create(capacity);
}