Example usage for java.util.concurrent ForkJoinPool getQueuedSubmissionCount

List of usage examples for java.util.concurrent ForkJoinPool getQueuedSubmissionCount

Introduction

In this page you can find the example usage for java.util.concurrent ForkJoinPool getQueuedSubmissionCount.

Prototype

public int getQueuedSubmissionCount() 

Source Link

Document

Returns an estimate of the number of tasks submitted to this pool that have not yet begun executing.

Usage

From source file:uniol.apt.analysis.synthesize.FindWords.java

static private <T> int submitTasks(ForkJoinPool executor, CompletionService<T> completion,
        Iterator<Callable<T>> jobGenerator) {
    int submitted = 0;
    while (jobGenerator.hasNext() && executor.getQueuedSubmissionCount() < TARGET_JOB_QUEUE_SIZE) {
        completion.submit(jobGenerator.next());
        submitted++;/*from w  ww. j av  a 2s  . com*/
    }
    return submitted;
}