@Override public void execute(Runnable r) { executor.execute(r); }
@Override public void execute(Runnable r) { executor.execute(r); }
private FastList<ForkJoinTask<PT>> createAndExecuteTasks(ForkJoinPool executor, ProcedureFactory<PT> procedureFactory, List<T> list) { FastList<ForkJoinTask<PT>> tasks = FastList.newList(this.taskCount); int sectionSize = list.size() / this.taskCount; int taskCountMinusOne = this.taskCount - 1; for (int index = 0; index < this.taskCount; index++) { ForkJoinTask<PT> task = this.createTask(procedureFactory, list, sectionSize, taskCountMinusOne, index); tasks.add(task); executor.execute(task); } return tasks; }
private FastList<ForkJoinTask<PT>> createAndExecuteTasks(ForkJoinPool executor, ObjectIntProcedureFactory<PT> procedureFactory, List<T> list) { FastList<ForkJoinTask<PT>> tasks = FastList.newList(this.taskCount); int sectionSize = list.size() / this.taskCount; int taskCountMinusOne = this.taskCount - 1; for (int index = 0; index < this.taskCount; index++) { ForkJoinTask<PT> task = this.createTask(procedureFactory, list, sectionSize, taskCountMinusOne, index); tasks.add(task); executor.execute(task); } return tasks; }
private FastList<ForkJoinTask<PT>> createAndExecuteTasks(ForkJoinPool executor, ProcedureFactory<PT> procedureFactory, BatchIterable<T> iterable) { FastList<ForkJoinTask<PT>> tasks = FastList.newList(this.taskCount); for (int index = 0; index < this.taskCount; index++) { ForkJoinTask<PT> voidBlockFJTask = new FJBatchIterableProcedureTask<>(this, procedureFactory, iterable, index, this.taskCount); tasks.add(voidBlockFJTask); executor.execute(voidBlockFJTask); } return tasks; }
try { BaseCuboidTask<T> task = new BaseCuboidTask<>(inputController, 1, resultWatcher); builderPool.execute(task); do { builderList.add(task.getInternalBuilder());
__ -> { }, () -> captureCompletion.set(true), s -> ForkJoinPool.commonPool().execute(() -> RaceTestUtils.race(s::cancel, () -> s.request(1), Schedulers.parallel())
/** * Update the count of each directory with quota in the namespace. * A directory's count is defined as the total number inodes in the tree * rooted at the directory. * * This is an update of existing state of the filesystem and does not * throw QuotaExceededException. */ void updateCountForQuota(int initThreads) { writeLock(); try { int threads = (initThreads < 1) ? 1 : initThreads; LOG.info("Initializing quota with " + threads + " thread(s)"); long start = Time.monotonicNow(); QuotaCounts counts = new QuotaCounts.Builder().build(); ForkJoinPool p = new ForkJoinPool(threads); RecursiveAction task = new InitQuotaTask(getBlockStoragePolicySuite(), rootDir.getStoragePolicyID(), rootDir, counts); p.execute(task); task.join(); p.shutdown(); LOG.info("Quota initialization completed in " + (Time.monotonicNow() - start) + " milliseconds\n" + counts); } finally { writeUnlock(); } }
/** * Run the provided task on the thread pool backing this runtime. * @param task Task to make eligible for execution. */ public static void submitTask(final BaseTask task) { taskPool.execute(task); }
private void stopLater() { // Stop from an other thread so that it does not get stuck // when this method runs on an executor thread. ForkJoinPool.commonPool().execute(this::stop); }
private void stopLater() { // Stop from an other thread so that it does not get stuck // when this method runs on an executor thread. ForkJoinPool.commonPool().execute(this::stop); }
@Override public void init() throws ServletException { // Warm the logger ForkJoinPool.commonPool().execute(Logs::getLoggers); // Create Object JSON mapper mapper = new ObjectMapper(); LOGGER.trace("Init of LogUiServlet complete."); //$NON-NLS-1$ super.init(); }
private void stopLater() { // Stop from an other thread so that it does not get stuck // when this method runs on an executor thread. ForkJoinPool.commonPool().execute(this::stop); }
@Override protected void schedule(int actorId) { pool.execute(new ActorForkJoinTask(this, mailboxes[actorId])); } }
public void spinUp(final Nukleus nukleus) { Wrapper[] oldArray = nukleusArrayRef.get(); Wrapper[] newArray = Arrays.copyOf(oldArray, oldArray.length + 1); newArray[oldArray.length] = new Wrapper(nukleus, pool); pool.execute(newArray[oldArray.length]); nukleusArrayRef.lazySet(newArray); }
public void run() { final int weight = nukleus.process(); idler.idle(weight); pool.execute(this); } }
private FastList<ForkJoinTask<PT>> createAndExecuteTasks(ForkJoinPool executor, ProcedureFactory<PT> procedureFactory, BatchIterable<T> iterable) { FastList<ForkJoinTask<PT>> tasks = FastList.newList(this.taskCount); for (int index = 0; index < this.taskCount; index++) { ForkJoinTask<PT> voidBlockFJTask = new FJBatchIterableProcedureTask<>(this, procedureFactory, iterable, index, this.taskCount); tasks.add(voidBlockFJTask); executor.execute(voidBlockFJTask); } return tasks; }
private final void tryScheduleToExecute() { try { ForkJoinPool.commonPool().execute(this); } catch (Throwable t) { close(); // no further notifying (executor does not work anyway) subscriber.onError(t); } }
private FastList<ForkJoinTask<PT>> createAndExecuteTasks(ForkJoinPool executor, ProcedureFactory<PT> procedureFactory, BatchIterable<T> iterable) { FastList<ForkJoinTask<PT>> tasks = FastList.newList(this.taskCount); for (int index = 0; index < this.taskCount; index++) { ForkJoinTask<PT> voidBlockFJTask = new FJBatchIterableProcedureTask<>(this, procedureFactory, iterable, index, this.taskCount); tasks.add(voidBlockFJTask); executor.execute(voidBlockFJTask); } return tasks; }
private void runClientRequests(TestContext ctx) { Async clientsFinished = ctx.async(concurrentClients); for (int i = 0; i < concurrentClients; i++) { ForkJoinPool.commonPool().execute(() -> { NetClient client = vertx.createNetClient(); request(client, ctx); clientsFinished.countDown(); }); } clientsFinished.awaitSuccess(); }