Package groovyx.gpars.scheduler

Examples of groovyx.gpars.scheduler.DefaultPool


    /**
     * Creates a group for actors, agents, tasks and operators. The actors will share a common non-daemon thread pool.
     */
    public NonDaemonPGroup() {
        super(GParsConfig.getPoolFactory() == null ? new DefaultPool(false) : GParsConfig.getPoolFactory().createPool(false));
    }
View Full Code Here


     * Creates a group for actors, agents, tasks and operators. The actors will share a common non-daemon thread pool.
     *
     * @param poolSize The initial size of the underlying thread pool
     */
    public NonDaemonPGroup(final int poolSize) {
        super(GParsConfig.getPoolFactory() == null ? new DefaultPool(false, poolSize) : GParsConfig.getPoolFactory().createPool(false, poolSize));
    }
View Full Code Here

    /**
     * Creates a group for actors, agents, tasks and operators. The actors will share a common daemon thread pool.
     */
    public DefaultPGroup() {
        super(GParsConfig.getPoolFactory() == null ? new DefaultPool(true) : GParsConfig.getPoolFactory().createPool(true));
    }
View Full Code Here

     * Creates a group for actors, agents, tasks and operators. The actors will share a common daemon thread pool.
     *
     * @param poolSize The initial size of the underlying thread pool
     */
    public DefaultPGroup(final int poolSize) {
        super(GParsConfig.getPoolFactory() == null ? new DefaultPool(true, poolSize) : GParsConfig.getPoolFactory().createPool(true, poolSize));
    }
View Full Code Here

     *
     * @param pool The pool to wrap by the new group
     * @return The group wrapping the original pool
     */
    public static PGroup createFromPool(final ThreadPoolExecutor pool) {
        return new DefaultPGroup(new DefaultPool(pool));
    }
View Full Code Here

        for (int index = 0; index <= 3; index++) {
            final int concurrencyLevel = 20;

            // All actors in this group share the same thread pool
            final PGroup group = new DefaultPGroup(new DefaultPool(true, concurrencyLevel));

            final long t1 = System.currentTimeMillis();
            // With each message received counter is decreased by the actors
            final int latchCount = ACTORS * MESSAGES;
            final CountDownLatch cdl = new CountDownLatch(latchCount);
View Full Code Here

        final StatefulDynamicDispatchActor downloader = new WriteStatefulDynamicDispatchActor();

        downloader.follower = indexer;
        indexer.follower = writer;

        final PGroup group = new DefaultPGroup(new DefaultPool(false, 4));

        writer.setParallelGroup(group);
        indexer.setParallelGroup(group);
        downloader.setParallelGroup(group);
        downloader.follower = indexer;
View Full Code Here

TOP

Related Classes of groovyx.gpars.scheduler.DefaultPool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.