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

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

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

ForkJoinPool.helpSignal介绍

[英]Scans through queues looking for work while joining a task; if any present, signals. May return early if more signalling is detectably unneeded.
[中]在加入任务时扫描队列以查找工作;如果有,请发送信号。如果检测到不需要更多信号,则可能提前返回。

代码示例

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

p.externalHelpComplete(q, t);
else
  p.helpSignal(t, q.poolIndex);

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

helpSignal(task, joiner.poolIndex);
if ((s = task.status) >= 0 &&
  (task instanceof CountedCompleter))
   (s = tryHelpStealer(joiner, task)) == 0) &&
  (s = task.status) >= 0) {
  helpSignal(task, joiner.poolIndex);
  if ((s = task.status) >= 0 && tryCompensate()) {
    if (task.trySetSignal() && (s = task.status) >= 0) {

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

break;
if (task == null) {
  helpSignal(root, q.poolIndex);
  if (root.status >= 0)
    helpComplete(root, SHARED_QUEUE);

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

/**
 * Stripped-down variant of awaitJoin used by timed joins. Tries
 * to help join only while there is continuous progress. (Caller
 * will then enter a timed wait.)
 *
 * @param joiner the joining worker
 * @param task the task
 */
final void helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) {
  int s;
  if (joiner != null && task != null && (s = task.status) >= 0) {
    ForkJoinTask<?> prevJoin = joiner.currentJoin;
    joiner.currentJoin = task;
    do {} while ((s = task.status) >= 0 && !joiner.isEmpty() &&
           joiner.tryRemoveAndExec(task));
    if (s >= 0 && (s = task.status) >= 0) {
      helpSignal(task, joiner.poolIndex);
      if ((s = task.status) >= 0 &&
        (task instanceof CountedCompleter))
        s = helpComplete(task, LIFO_QUEUE);
    }
    if (s >= 0 && joiner.isEmpty()) {
      do {} while (task.status >= 0 &&
             tryHelpStealer(joiner, task) > 0);
    }
    joiner.currentJoin = prevJoin;
  }
}

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

p.externalHelpComplete(q, t);
else
  p.helpSignal(t, q.poolIndex);

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

p.externalHelpComplete(q, t);
else
  p.helpSignal(t, q.poolIndex);

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

p.externalHelpComplete(q, t);
else
  p.helpSignal(t, q.poolIndex);

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

p.externalHelpComplete(q, t);
else
  p.helpSignal(t, q.poolIndex);

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

p.externalHelpComplete(q, t);
else
  p.helpSignal(t, q.poolIndex);

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

helpSignal(task, joiner.poolIndex);
if ((s = task.status) >= 0 &&
  (task instanceof CountedCompleter))
   (s = tryHelpStealer(joiner, task)) == 0) &&
  (s = task.status) >= 0) {
  helpSignal(task, joiner.poolIndex);
  if ((s = task.status) >= 0 && tryCompensate()) {
    if (task.trySetSignal() && (s = task.status) >= 0) {

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

p.externalHelpComplete(q, t);
else
  p.helpSignal(t, q.poolIndex);

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

break;
if (task == null) {
  helpSignal(root, q.poolIndex);
  if (root.status >= 0)
    helpComplete(root, SHARED_QUEUE);

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

break;
if (task == null) {
  helpSignal(root, q.poolIndex);
  if (root.status >= 0)
    helpComplete(root, SHARED_QUEUE);

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

break;
if (task == null) {
  helpSignal(root, q.poolIndex);
  if (root.status >= 0)
    helpComplete(root, SHARED_QUEUE);

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

/**
 * Stripped-down variant of awaitJoin used by timed joins. Tries
 * to help join only while there is continuous progress. (Caller
 * will then enter a timed wait.)
 *
 * @param joiner the joining worker
 * @param task the task
 */
final void helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) {
  int s;
  if (joiner != null && task != null && (s = task.status) >= 0) {
    ForkJoinTask<?> prevJoin = joiner.currentJoin;
    joiner.currentJoin = task;
    do {} while ((s = task.status) >= 0 && !joiner.isEmpty() &&
           joiner.tryRemoveAndExec(task));
    if (s >= 0 && (s = task.status) >= 0) {
      helpSignal(task, joiner.poolIndex);
      if ((s = task.status) >= 0 &&
        (task instanceof CountedCompleter))
        s = helpComplete(task, LIFO_QUEUE);
    }
    if (s >= 0 && joiner.isEmpty()) {
      do {} while (task.status >= 0 &&
             tryHelpStealer(joiner, task) > 0);
    }
    joiner.currentJoin = prevJoin;
  }
}

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

/**
 * Stripped-down variant of awaitJoin used by timed joins. Tries
 * to help join only while there is continuous progress. (Caller
 * will then enter a timed wait.)
 *
 * @param joiner the joining worker
 * @param task the task
 */
final void helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) {
  int s;
  if (joiner != null && task != null && (s = task.status) >= 0) {
    ForkJoinTask<?> prevJoin = joiner.currentJoin;
    joiner.currentJoin = task;
    do {} while ((s = task.status) >= 0 && !joiner.isEmpty() &&
           joiner.tryRemoveAndExec(task));
    if (s >= 0 && (s = task.status) >= 0) {
      helpSignal(task, joiner.poolIndex);
      if ((s = task.status) >= 0 &&
        (task instanceof CountedCompleter))
        s = helpComplete(task, LIFO_QUEUE);
    }
    if (s >= 0 && joiner.isEmpty()) {
      do {} while (task.status >= 0 &&
             tryHelpStealer(joiner, task) > 0);
    }
    joiner.currentJoin = prevJoin;
  }
}

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

/**
 * Stripped-down variant of awaitJoin used by timed joins. Tries
 * to help join only while there is continuous progress. (Caller
 * will then enter a timed wait.)
 *
 * @param joiner the joining worker
 * @param task the task
 */
final void helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) {
  int s;
  if (joiner != null && task != null && (s = task.status) >= 0) {
    ForkJoinTask<?> prevJoin = joiner.currentJoin;
    joiner.currentJoin = task;
    do {} while ((s = task.status) >= 0 && !joiner.isEmpty() &&
           joiner.tryRemoveAndExec(task));
    if (s >= 0 && (s = task.status) >= 0) {
      helpSignal(task, joiner.poolIndex);
      if ((s = task.status) >= 0 &&
        (task instanceof CountedCompleter))
        s = helpComplete(task, LIFO_QUEUE);
    }
    if (s >= 0 && joiner.isEmpty()) {
      do {} while (task.status >= 0 &&
             tryHelpStealer(joiner, task) > 0);
    }
    joiner.currentJoin = prevJoin;
  }
}

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

/**
 * Stripped-down variant of awaitJoin used by timed joins. Tries
 * to help join only while there is continuous progress. (Caller
 * will then enter a timed wait.)
 *
 * @param joiner the joining worker
 * @param task the task
 */
final void helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) {
  int s;
  if (joiner != null && task != null && (s = task.status) >= 0) {
    ForkJoinTask<?> prevJoin = joiner.currentJoin;
    joiner.currentJoin = task;
    do {} while ((s = task.status) >= 0 && !joiner.isEmpty() &&
           joiner.tryRemoveAndExec(task));
    if (s >= 0 && (s = task.status) >= 0) {
      helpSignal(task, joiner.poolIndex);
      if ((s = task.status) >= 0 &&
        (task instanceof CountedCompleter))
        s = helpComplete(task, LIFO_QUEUE);
    }
    if (s >= 0 && joiner.isEmpty()) {
      do {} while (task.status >= 0 &&
             tryHelpStealer(joiner, task) > 0);
    }
    joiner.currentJoin = prevJoin;
  }
}

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

/**
 * Stripped-down variant of awaitJoin used by timed joins. Tries
 * to help join only while there is continuous progress. (Caller
 * will then enter a timed wait.)
 *
 * @param joiner the joining worker
 * @param task the task
 */
final void helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) {
  int s;
  if (joiner != null && task != null && (s = task.status) >= 0) {
    ForkJoinTask<?> prevJoin = joiner.currentJoin;
    joiner.currentJoin = task;
    do {} while ((s = task.status) >= 0 && !joiner.isEmpty() &&
           joiner.tryRemoveAndExec(task));
    if (s >= 0 && (s = task.status) >= 0) {
      helpSignal(task, joiner.poolIndex);
      if ((s = task.status) >= 0 &&
        (task instanceof CountedCompleter))
        s = helpComplete(task, LIFO_QUEUE);
    }
    if (s >= 0 && joiner.isEmpty()) {
      do {} while (task.status >= 0 &&
             tryHelpStealer(joiner, task) > 0);
    }
    joiner.currentJoin = prevJoin;
  }
}

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

/**
 * Stripped-down variant of awaitJoin used by timed joins. Tries
 * to help join only while there is continuous progress. (Caller
 * will then enter a timed wait.)
 *
 * @param joiner the joining worker
 * @param task the task
 */
final void helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) {
  int s;
  if (joiner != null && task != null && (s = task.status) >= 0) {
    ForkJoinTask<?> prevJoin = joiner.currentJoin;
    joiner.currentJoin = task;
    do {} while ((s = task.status) >= 0 && !joiner.isEmpty() &&
           joiner.tryRemoveAndExec(task));
    if (s >= 0 && (s = task.status) >= 0) {
      helpSignal(task, joiner.poolIndex);
      if ((s = task.status) >= 0 &&
        (task instanceof CountedCompleter))
        s = helpComplete(task, LIFO_QUEUE);
    }
    if (s >= 0 && joiner.isEmpty()) {
      do {} while (task.status >= 0 &&
             tryHelpStealer(joiner, task) > 0);
    }
    joiner.currentJoin = prevJoin;
  }
}

相关文章

ForkJoinPool类方法