Examples of WorkerThread


Examples of edu.ucla.sspace.util.WorkerThread

     * 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

Examples of edu.ucla.sspace.util.WorkerThread

        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

Examples of edu.ucla.sspace.util.WorkerThread

        // 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

Examples of it.freedomotic.plugins.fromfile.WorkerThread

                coord.add(c);
            }

            fr.close();

            WorkerThread wt = new WorkerThread(this, coord);
            workers.add(wt);
        } catch (FileNotFoundException ex) {
            System.out.println("Coordinates file not found for mote " + n);
        } catch (IOException ex) {
            Logger.getLogger(TrackingReadFile.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

Examples of org.apache.roller.business.runnable.WorkerThread

       
        if(this.workers != null && this.workers.size() > 0) {
            mLogger.info("stopping all ReferrerQueue worker threads");
           
            // kill all of our threads
            WorkerThread worker = null;
            Iterator it = this.workers.iterator();
            while(it.hasNext()) {
                worker = (WorkerThread) it.next();
                worker.interrupt();
            }
        }
       
    }
View Full Code Here

Examples of org.apache.roller.business.runnable.WorkerThread

       
        if(this.workers != null && this.workers.size() > 0) {
            mLogger.info("stopping all ReferrerQueue worker threads");
           
            // kill all of our threads
            WorkerThread worker = null;
            Iterator it = this.workers.iterator();
            while(it.hasNext()) {
                worker = (WorkerThread) it.next();
                worker.interrupt();
            }
        }
       
    }
View Full Code Here

Examples of org.apache.roller.weblogger.business.runnable.WorkerThread

       
        if(this.workers != null && this.workers.size() > 0) {
            mLogger.info("stopping all ReferrerQueue worker threads");
           
            // kill all of our threads
            WorkerThread worker = null;
            Iterator it = this.workers.iterator();
            while(it.hasNext()) {
                worker = (WorkerThread) it.next();
                worker.interrupt();
            }
        }
       
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.