Package edu.ucla.sspace.util

Examples of edu.ucla.sspace.util.WorkerThread


        // Set up the concurrent data structures so we can process the documents
        // concurrently
        final BlockingQueue<Runnable> workQueue =
            new LinkedBlockingQueue<Runnable>();
        for (int i = 0; i < Runtime.getRuntime().availableProcessors(); ++i) {
            Thread t = new WorkerThread(workQueue);
            t.start();
        }
        final Semaphore termsProcessed = new Semaphore(0);
       
        for (int termIndex = 0; termIndex < uniqueTerms; ++termIndex) {
           
View Full Code Here


     * Creates this {@code WordComparator} with the specified number of threads.
     */
    public WordComparator(int numThreads) {
        workQueue = new LinkedBlockingQueue<Runnable>();
        for (int i = 0; i < numThreads; ++i) {
            new WorkerThread(workQueue, 10).start();           
        }
    }
View Full Code Here

        int numThreads = Runtime.getRuntime().availableProcessors();

        final BlockingQueue<Runnable> workQueue =
            new LinkedBlockingQueue<Runnable>();
        for (int i = 0; i < numThreads; ++i) {
            Thread t = new WorkerThread(workQueue);
            t.start();
        }
        final Semaphore itemsProcessed = new Semaphore(0);

        // Set up thread safe counters for the final data points we need to
        // report.
View Full Code Here

        // Set up the concurrent data structures so we can reprocess the
        // documents concurrently using a work queue
        final BlockingQueue<Runnable> workQueue =
            new LinkedBlockingQueue<Runnable>();
        for (int i = 0; i < Runtime.getRuntime().availableProcessors(); ++i) {
            Thread t = new WorkerThread(workQueue);
            t.start();
        }
        final Semaphore documentsRerocessed = new Semaphore(0);        

        for (int d = 0; d < numDocuments; ++d) {
            final int docId = d;
View Full Code Here

TOP

Related Classes of edu.ucla.sspace.util.WorkerThread

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.