Package java.util.concurrent

Examples of java.util.concurrent.ForkJoinPool.awaitTermination()


    pool.shutdown();
   
   
    // Wait for the finalization of the task
    try {
      pool.awaitTermination(1, TimeUnit.DAYS);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
   
    // Write a message to indicate the end of the program
View Full Code Here


    ForkJoinPool pool=new ForkJoinPool();
    start=new Date();
    pool.execute(taskFJ);
    pool.shutdown();
    try {
      pool.awaitTermination(1, TimeUnit.DAYS);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    end=new Date();
    System.out.printf("Core: Fork/Join: %d\n",(end.getTime()-start.getTime()));
View Full Code Here

    // Shutdown the pool
    pool.shutdown();
   
    // Wait for the finalization of the tasks
    try {
      pool.awaitTermination(1, TimeUnit.DAYS);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
   
    System.out.printf("Main: The program has finished.\n");
View Full Code Here

    pool.shutdown();
   
    /*
     * Wait for the finalization of the pool
     */
    pool.awaitTermination(1, TimeUnit.DAYS);
   
    /*
     * End of the program
     */
    showLog(pool);
 
View Full Code Here

    // Shutdown the pool
    pool.shutdown();
   
    // Wait for the finalization of the tasks
    try {
      pool.awaitTermination(1, TimeUnit.DAYS);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
   
    // Write the results of the tasks
View Full Code Here

    // Shutdown the ForkJoinPool
    pool.shutdown();
   
    // Wait for the finalization of the task
    try {
      pool.awaitTermination(1, TimeUnit.DAYS);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
   
    // Check if the task has thrown an Exception. If it's the case, write it
View Full Code Here

    pool.shutdown();
   
    /*
     * Wait for the finalization of the pool
     */
    pool.awaitTermination(1, TimeUnit.DAYS);
   
    /*
     * Write the result of the task
     */
    System.out.printf("Main: Result: %d\n",task.get());
View Full Code Here

        pool.invoke(new PatternMatcher(regex, input, matches, db, graphManager));

        // Cleaning up after yourself is important
        pool.shutdown();
        try {
            pool.awaitTermination(5, TimeUnit.SECONDS);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        return matches;
View Full Code Here

        // Shutdown the pool
        pool.shutdown();

        // Wait for the finalization of the tasks
        try {
            pool.awaitTermination(1, TimeUnit.DAYS);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        // Write the results of the tasks
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.