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

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

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

ForkJoinPool.helpQuiescePool介绍

[英]Runs tasks until isQuiescent(). We piggyback on active count ctl maintenance, but rather than blocking when tasks cannot be found, we rescan until all others cannot find tasks either.
[中]运行任务直到isquisite()。我们依靠活动计数ctl维护,但不是在找不到任务时阻塞,而是重新扫描,直到所有其他任务也找不到。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

代码示例来源:origin: ibinti/bugvm

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

代码示例来源:origin: MobiVM/robovm

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

代码示例来源:origin: hm.binkley/binkley-util

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.quiesceCommonPool();
}

相关文章

微信公众号

最新文章

更多

ForkJoinPool类方法