Package jsr166e

Examples of jsr166e.ForkJoinPool


        this.fjPool = new WeakReference<ForkJoinPool>(fjPool);
        instances.put(fjPool, this);
    }
   
    protected ForkJoinPool fjPool() {
        final ForkJoinPool fjPool = this.fjPool.get();
        return fjPool;
    }
View Full Code Here


        ACTIVE, QUIESCENT, SHUTDOWN, TERMINATING, TERMINATED
    }

    @Override
    protected ForkJoinPool fjPool() {
        final ForkJoinPool fjPool = super.fjPool();
        if (fjPool == null) {
            unregisterMBean();
            throw new RuntimeException("Pool collected");
        }
        return fjPool;
View Full Code Here

        return fjPool;
    }

    @Override
    public Status getStatus() {
        final ForkJoinPool fjPool = fjPool();
        if (fjPool.isTerminated()) // Returns true if all tasks have completed following shut down.
            return Status.TERMINATED;
        if (fjPool.isTerminating()) // Returns true if the process of termination has commenced but not yet completed.
            return Status.TERMINATING;
        if (fjPool.isShutdown()) // Returns true if this pool has been shut down.
            return Status.SHUTDOWN;
        if (fjPool.isQuiescent()) // Returns true if all worker threads are currently idle.
            return Status.QUIESCENT;
        return Status.ACTIVE;
    }
View Full Code Here

        return fjPool().getPoolSize(); // Returns the number of worker threads that have started but not yet terminated.
    }

    @Override
    public ForkJoinInfo getInfo() {
        final ForkJoinPool fjPool = fjPool();
        int activeThreadCount = fjPool.getActiveThreadCount(); // Returns an estimate of the number of threads that are currently stealing or executing tasks.
        int runningThreadCount = fjPool.getRunningThreadCount(); // Returns an estimate of the number of worker threads that are not blocked waiting to join tasks or for other managed synchronization.
        int queuedSumbmissionCount = fjPool.getQueuedSubmissionCount(); // Returns an estimate of the number of tasks submitted to this pool that have not yet begun executing.
        long queuedTaskCount = fjPool.getQueuedTaskCount(); // Returns an estimate of the total number of tasks currently held in queues by worker threads (but not including tasks submitted to the pool that have not begun executing).
        long stealCount = fjPool.getStealCount(); //  Returns an estimate of the total number of tasks stolen from one thread's work queue by another.

        return new ForkJoinInfo(activeThreadCount, runningThreadCount, queuedSumbmissionCount, queuedTaskCount, stealCount);
    }
View Full Code Here

TOP

Related Classes of jsr166e.ForkJoinPool

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.