本文整理汇总了Java中org.threadly.concurrent.PriorityScheduler.prestartAllThreads方法的典型用法代码示例。如果您正苦于以下问题:Java PriorityScheduler.prestartAllThreads方法的具体用法?Java PriorityScheduler.prestartAllThreads怎么用?Java PriorityScheduler.prestartAllThreads使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.threadly.concurrent.PriorityScheduler
的用法示例。
在下文中一共展示了PriorityScheduler.prestartAllThreads方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWithTimeoutResultTest
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
@Test
public void getWithTimeoutResultTest() throws InterruptedException,
ExecutionException,
TimeoutException {
final String testResult = StringUtils.makeRandomString(5);
PriorityScheduler scheduler = new StrictPriorityScheduler(1);
try {
scheduler.prestartAllThreads();
scheduler.schedule(new Runnable() {
@Override
public void run() {
slf.setResult(testResult);
}
}, DELAY_TIME);
assertTrue(slf.get(DELAY_TIME + (SLOW_MACHINE ? 2000 : 1000), TimeUnit.MILLISECONDS) == testResult);
} finally {
scheduler.shutdownNow();
}
}
示例2: KeyDistributedExecutorUniqueKeyBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public KeyDistributedExecutorUniqueKeyBenchmark(int submitterQty) {
this.submitterQty = submitterQty;
scheduler = new PriorityScheduler(submitterQty * 2);
scheduler.prestartAllThreads();
distributor = new KeyDistributedScheduler(scheduler);
lastRunnable = new AtomicReferenceArray<DistributorRunnable>(submitterQty);
}
示例3: KeyDistributedSchedulerRecurringBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public KeyDistributedSchedulerRecurringBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
originalExecutor = new PriorityScheduler(poolSize, TaskPriority.High, 0);
originalExecutor.prestartAllThreads();
keyScheduler = new KeyDistributedScheduler(originalExecutor);
}
示例4: KeyedLimiterRecurringBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public KeyedLimiterRecurringBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
originalExecutor = new PriorityScheduler(poolSize, TaskPriority.High, 0);
originalExecutor.prestartAllThreads();
keyLimiter = new KeyedSubmitterSchedulerLimiter(originalExecutor, Integer.MAX_VALUE);
}
示例5: KeyedLimiterScheduleBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public KeyedLimiterScheduleBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
originalExecutor = new PriorityScheduler(poolSize, TaskPriority.High, 0);
originalExecutor.prestartAllThreads();
keyLimiter = new KeyedSubmitterSchedulerLimiter(originalExecutor, Integer.MAX_VALUE);
}
示例6: KeyDistributedExecutorManySubmitterBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public KeyDistributedExecutorManySubmitterBenchmark(int submitterQty) {
executor = new PriorityScheduler(submitterQty * 2);
executor.prestartAllThreads();
distributor = new KeyDistributedScheduler(executor);
this.submitterQty = submitterQty;
lastRunnable =
new AtomicReferenceArray<DistributorRunnable>(submitterQty);
}
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:10,代码来源:KeyDistributedExecutorManySubmitterBenchmark.java
示例7: PrioritySchedulerScheduleBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public PrioritySchedulerScheduleBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
// change to StrictPriorityScheduler for testing logic (and then run inside eclipse)
scheduler = new PriorityScheduler(poolSize, TaskPriority.High, 0);
scheduler.prestartAllThreads();
}
示例8: SubmitterSchedulerLimiterRecurringBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public SubmitterSchedulerLimiterRecurringBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
originalExecutor = new PriorityScheduler(poolSize, TaskPriority.High, 0);
originalExecutor.prestartAllThreads();
executor = new SubmitterSchedulerLimiter(originalExecutor, Integer.MAX_VALUE);
}
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:SubmitterSchedulerLimiterRecurringBenchmark.java
示例9: PrioritySchedulerExecuteBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public PrioritySchedulerExecuteBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
// change to StrictPriorityScheduler for testing logic (and then run inside eclipse)
scheduler = new PriorityScheduler(poolSize, TaskPriority.High, 0);
scheduler.prestartAllThreads();
}
示例10: SubmitterSchedulerLimiterScheduleBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public SubmitterSchedulerLimiterScheduleBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
originalExecutor = new PriorityScheduler(poolSize, TaskPriority.High, 0);
originalExecutor.prestartAllThreads();
executor = new SubmitterSchedulerLimiter(originalExecutor, Integer.MAX_VALUE);
}
示例11: KeyDistributedSchedulerExecuteBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public KeyDistributedSchedulerExecuteBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
originalExecutor = new PriorityScheduler(poolSize, TaskPriority.High, 0);
originalExecutor.prestartAllThreads();
keyScheduler = new KeyDistributedScheduler(originalExecutor);
}
示例12: KeyDistributedSchedulerScheduleBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public KeyDistributedSchedulerScheduleBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
originalExecutor = new PriorityScheduler(poolSize, TaskPriority.High, 0);
originalExecutor.prestartAllThreads();
keyScheduler = new KeyDistributedScheduler(originalExecutor);
}
示例13: PrioritySchedulerRecurringBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public PrioritySchedulerRecurringBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
// change to StrictPriorityScheduler for testing logic (and then run inside eclipse)
scheduler = new PriorityScheduler(poolSize, TaskPriority.High, 0);
scheduler.prestartAllThreads();
}
示例14: SubmitterSchedulerLimiterExecuteBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public SubmitterSchedulerLimiterExecuteBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
originalExecutor = new PriorityScheduler(poolSize, TaskPriority.High, 0);
originalExecutor.prestartAllThreads();
executor = new SubmitterSchedulerLimiter(originalExecutor, Integer.MAX_VALUE);
}
示例15: KeyedLimiterExecuteBenchmark
import org.threadly.concurrent.PriorityScheduler; //导入方法依赖的package包/类
public KeyedLimiterExecuteBenchmark(int threadRunTime, int poolSize) {
super(threadRunTime);
originalExecutor = new PriorityScheduler(poolSize, TaskPriority.High, 0);
originalExecutor.prestartAllThreads();
keyLimiter = new KeyedSubmitterSchedulerLimiter(originalExecutor, Integer.MAX_VALUE);
}