java.util.concurrent.ForkJoinPool.getQueuedTaskCount()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中java.util.concurrent.ForkJoinPool.getQueuedTaskCount()方法的一些代码示例,展示了ForkJoinPool.getQueuedTaskCount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ForkJoinPool.getQueuedTaskCount()方法的具体详情如下:
包路径:java.util.concurrent.ForkJoinPool
类名称:ForkJoinPool
方法名:getQueuedTaskCount

ForkJoinPool.getQueuedTaskCount介绍

[英]Returns an estimate of the total number of tasks currently held in queues by worker threads (but not including tasks submitted to the pool that have not begun executing). This value is only an approximation, obtained by iterating across all threads in the pool. This method may be useful for tuning task granularities.
[中]返回工作线程当前在队列中保留的任务总数的估计值(但不包括提交到池中尚未开始执行的任务)。该值只是一个近似值,通过在池中的所有线程上迭代获得。此方法可能有助于调整任务粒度。

代码示例

代码示例来源:origin: co.paralleluniverse/quasar-core

@Override
  public Long getValue() {
    return fjPool().getQueuedTaskCount();
  }
});

代码示例来源:origin: coffeewar/enode-master

@Override
public long getQueuedTaskCount() {
  return java.util.concurrent.ForkJoinPool.commonPool().getQueuedTaskCount();
}

代码示例来源:origin: co.paralleluniverse/quasar-core

@Override
public long getQueuedTaskCount() {
  return fjPool().getQueuedTaskCount();
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

long qt = getQueuedTaskCount();
long qs = getQueuedSubmissionCount();
int pc = parallelism;

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

long qt = getQueuedTaskCount();
long qs = getQueuedSubmissionCount();
int pc = parallelism;

代码示例来源:origin: jtulach/bck2brwsr

long qt = getQueuedTaskCount();
long qs = getQueuedSubmissionCount();
int pc = parallelism;

代码示例来源:origin: com.arpnetworking.metrics.extras/jvm-extra

prefix,
        "queued_tasks"),
    executorService.getQueuedTaskCount());
metrics.setGauge(
    String.join(

代码示例来源:origin: co.paralleluniverse/quasar-core

@Override
public ForkJoinInfo getInfo() {
  final ForkJoinPool fjPool = fjPool();
  int activeThreadCount = fjPool.getActiveThreadCount(); // Returns an estimate of the number of threads that are currently stealing or executing tasks.
  int runningThreadCount = fjPool.getRunningThreadCount(); // Returns an estimate of the number of worker threads that are not blocked waiting to join tasks or for other managed synchronization.
  int queuedSumbmissionCount = fjPool.getQueuedSubmissionCount(); // Returns an estimate of the number of tasks submitted to this pool that have not yet begun executing.
  long queuedTaskCount = fjPool.getQueuedTaskCount(); // Returns an estimate of the total number of tasks currently held in queues by worker threads (but not including tasks submitted to the pool that have not begun executing).
  long stealCount = fjPool.getStealCount(); //  Returns an estimate of the total number of tasks stolen from one thread's work queue by another.
  return new ForkJoinInfo(activeThreadCount, runningThreadCount, queuedSumbmissionCount, queuedTaskCount, stealCount);
}

代码示例来源:origin: stackoverflow.com

" runningThreads=" + pool.getRunningThreadCount() +
" poolSize=" + pool.getPoolSize() +
" queuedTasks=" + pool.getQueuedTaskCount() +
" queuedSubmissions=" + pool.getQueuedSubmissionCount() +
" parallelism=" + pool.getParallelism() +

相关文章

微信公众号

最新文章

更多

ForkJoinPool类方法