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

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

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

ForkJoinPool.runWorker介绍

[英]Top-level runloop for workers, called by ForkJoinWorkerThread.run.
[中]工作线程的顶级运行循环,由ForkJoinWorkerThread调用。跑

代码示例

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

/**
   * This method is required to be public, but should never be
   * called explicitly. It performs the main run loop to execute
   * {@link ForkJoinTask}s.
   */
  public void run() {
    Throwable exception = null;
    try {
      onStart();
      pool.runWorker(workQueue);
    } catch (Throwable ex) {
      exception = ex;
    } finally {
      try {
        onTermination(exception);
      } catch (Throwable ex) {
        if (exception == null)
          exception = ex;
      } finally {
        pool.deregisterWorker(this, exception);
      }
    }
  }
}

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

will deliberately fail
Exception in thread "main" Main$CustomException: forced failure
  at Main.lambda$main$0(Main.java:18)
  at java.util.stream.ForEachOps$ForEachOp$OfInt.accept(ForEachOps.java:205)
  at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:110)
  at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:693)
  at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
  at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
  at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
  at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
  at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
  at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
  at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

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

If yopu see the crash logs
Crash has occured in native code.
# Problematic frame:
# C  [jPortfolioPrecision-2.24.0.dll+0xe9fee]
#
Parallally you can check the stack trace of Java code. Which is leading to crash.
Problematic thread is ForkJoinPool.commonPool-worker-2.
You need to correct your native code..

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.axiomainc.portfolioprecision2.Portfolio.release()V+0
j  com.axiomainc.portfolioprecision.optimization.RebalancingSolution$RebRunInfo.destroy()V+107
J 3775 C1 com.axiomainc.portfolioprecision.optimization.RebalancingSolution.resetRebRunInfo()V (20 bytes) @ 0x00000000032c0d5c [0x00000000032c0c80+0xdc]
j  com.axiomainc.portfolioprecision.optimization.RebalancingSolution.reset()V+65
J 4098 C1 Auction$$Lambda$1.accept(Ljava/lang/Object;)V (8 bytes) @ 0x0000000003d88ddc [0x0000000003d88b00+0x2dc]
J 4097 C1 java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Ljava/lang/Object;)V (11 bytes) @ 0x0000000002f5cc5c [0x0000000002f5cb40+0x11c]
j  java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Ljava/util/function/Consumer;)V+99
j  java.util.stream.AbstractPipeline.copyInto(Ljava/util/stream/Sink;Ljava/util/Spliterator;)V+32
j  java.util.stream.ForEachOps$ForEachTask.compute()V+103
j  java.util.concurrent.CountedCompleter.exec()Z+1
j  java.util.concurrent.ForkJoinTask.doExec()I+10
j  java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Ljava/util/concurrent/ForkJoinTask;)V+21
j  java.util.concurrent.ForkJoinPool.runWorker(Ljava/util/concurrent/ForkJoinPool$WorkQueue;)V+35``
j  java.util.concurrent.ForkJoinWorkerThread.run()V+24
v  ~StubRoutines::call_stub

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

/**
   * This method is required to be public, but should never be
   * called explicitly. It performs the main run loop to execute
   * {@link ForkJoinTask}s.
   */
  public void run() {
    Throwable exception = null;
    try {
      onStart();
      pool.runWorker(workQueue);
    } catch (Throwable ex) {
      exception = ex;
    } finally {
      try {
        onTermination(exception);
      } catch (Throwable ex) {
        if (exception == null)
          exception = ex;
      } finally {
        pool.deregisterWorker(this, exception);
      }
    }
  }
}

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

"ForkJoinPool.commonPool-worker-2@710" daemon prio=5 tid=0xe nid=NA runnable java.lang.Thread.State: RUNNABLE
at java.util.stream.Stream$1.next(Stream.java:1033)
 at java.util.Spliterators$IteratorSpliterator.trySplit(Spliterators.java:1784)
 at java.util.stream.AbstractShortCircuitTask.compute(AbstractShortCircuitTask.java:114)
 at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
 at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
 at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:902)
 at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1689)
 at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1644)
 at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)`

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

/**
   * This method is required to be public, but should never be
   * called explicitly. It performs the main run loop to execute
   * {@link ForkJoinTask}s.
   */
  public void run() {
    Throwable exception = null;
    try {
      onStart();
      pool.runWorker(workQueue);
    } catch (Throwable ex) {
      exception = ex;
    } finally {
      try {
        onTermination(exception);
      } catch (Throwable ex) {
        if (exception == null)
          exception = ex;
      } finally {
        pool.deregisterWorker(this, exception);
      }
    }
  }
}

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

/**
   * This method is required to be public, but should never be
   * called explicitly. It performs the main run loop to execute
   * {@link ForkJoinTask}s.
   */
  public void run() {
    Throwable exception = null;
    try {
      onStart();
      pool.runWorker(workQueue);
    } catch (Throwable ex) {
      exception = ex;
    } finally {
      try {
        onTermination(exception);
      } catch (Throwable ex) {
        if (exception == null)
          exception = ex;
      } finally {
        pool.deregisterWorker(this, exception);
      }
    }
  }
}

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

/**
   * This method is required to be public, but should never be
   * called explicitly. It performs the main run loop to execute
   * {@link ForkJoinTask}s.
   */
  public void run() {
    Throwable exception = null;
    try {
      onStart();
      pool.runWorker(workQueue);
    } catch (Throwable ex) {
      exception = ex;
    } finally {
      try {
        onTermination(exception);
      } catch (Throwable ex) {
        if (exception == null)
          exception = ex;
      } finally {
        pool.deregisterWorker(this, exception);
      }
    }
  }
}

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

/**
   * This method is required to be public, but should never be
   * called explicitly. It performs the main run loop to execute
   * {@link ForkJoinTask}s.
   */
  public void run() {
    Throwable exception = null;
    try {
      onStart();
      pool.runWorker(workQueue);
    } catch (Throwable ex) {
      exception = ex;
    } finally {
      try {
        onTermination(exception);
      } catch (Throwable ex) {
        if (exception == null)
          exception = ex;
      } finally {
        pool.deregisterWorker(this, exception);
      }
    }
  }
}

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

/**
   * This method is required to be public, but should never be
   * called explicitly. It performs the main run loop to execute
   * {@link ForkJoinTask}s.
   */
  public void run() {
    Throwable exception = null;
    try {
      onStart();
      pool.runWorker(workQueue);
    } catch (Throwable ex) {
      exception = ex;
    } finally {
      try {
        onTermination(exception);
      } catch (Throwable ex) {
        if (exception == null)
          exception = ex;
      } finally {
        pool.deregisterWorker(this, exception);
      }
    }
  }
}

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

at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1689)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

相关文章

ForkJoinPool类方法