当前位置: 首页>>代码示例>>Java>>正文


Java PriorityScheduler.prestartAllThreads方法代码示例

本文整理汇总了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();
  }
}
 
开发者ID:threadly,项目名称:threadly,代码行数:22,代码来源:SettableListenableFutureTest.java

示例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);
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:KeyDistributedExecutorUniqueKeyBenchmark.java

示例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);
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:KeyDistributedSchedulerRecurringBenchmark.java

示例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);
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:KeyedLimiterRecurringBenchmark.java

示例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);
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:KeyedLimiterScheduleBenchmark.java

示例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();
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:PrioritySchedulerScheduleBenchmark.java

示例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();
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:PrioritySchedulerExecuteBenchmark.java

示例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);
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:SubmitterSchedulerLimiterScheduleBenchmark.java

示例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);
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:KeyDistributedSchedulerExecuteBenchmark.java

示例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);
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:KeyDistributedSchedulerScheduleBenchmark.java

示例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();
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:PrioritySchedulerRecurringBenchmark.java

示例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);
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:SubmitterSchedulerLimiterExecuteBenchmark.java

示例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);
}
 
开发者ID:threadly,项目名称:threadly_benchmarks,代码行数:8,代码来源:KeyedLimiterExecuteBenchmark.java


注:本文中的org.threadly.concurrent.PriorityScheduler.prestartAllThreads方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。