Example usage for java.util.concurrent Executors newWorkStealingPool

List of usage examples for java.util.concurrent Executors newWorkStealingPool

Introduction

In this page you can find the example usage for java.util.concurrent Executors newWorkStealingPool.

Prototype

public static ExecutorService newWorkStealingPool(int parallelism) 

Source Link

Document

Creates a thread pool that maintains enough threads to support the given parallelism level, and may use multiple queues to reduce contention.

Usage

From source file:tech.aroma.service.ModuleAromaService.java

@Override
protected void configure() {
    bind(ExecutorService.class).toInstance(Executors.newWorkStealingPool(15));

    install(new ServiceModule());
    install(new ModuleAromaServiceOperations());
}

From source file:com.oembedler.moon.graphql.engine.execute.GraphQLQueryExecutor.java

public GraphQLQueryExecutor forkJoinExecutorService(int parallelism) {
    this.executorService = Executors.newWorkStealingPool(parallelism);
    return this;
}

From source file:com.arpnetworking.tsdcore.sinks.circonus.CirconusClient.java

private CirconusClient(final Builder builder) {
    _uri = builder._uri;/*from   w w  w .  j  ava  2s  . com*/
    _appName = builder._appName;
    _authToken = builder._authToken;
    _executionContext = builder._executionContext;

    final AsyncHttpClientConfig.Builder clientBuilder = new AsyncHttpClientConfig.Builder();
    clientBuilder.setExecutorService(Executors.newWorkStealingPool(8));
    if (!builder._safeHttps.booleanValue()) {
        clientBuilder.setAcceptAnyCertificate(true);
        clientBuilder.setHostnameVerifier(HOST_NAME_VERIFIER);
    }
    _client = new NingWSClient(clientBuilder.build());
}