Package java.util.concurrent

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


    MyRecursiveTask task=new MyRecursiveTask(array,0,array.length);
   
    /*
     * Send the task to the ForkJoinPool
     */
    pool.execute(task);
   
   
    /*
     * Wait for the finalization of the task
     */
 
View Full Code Here


    FolderProcessor system=new FolderProcessor("C:\\Windows", "log");
    FolderProcessor apps=new FolderProcessor("C:\\Program Files","log");
    FolderProcessor documents=new FolderProcessor("C:\\Documents And Settings","log");
   
    // Execute the three tasks in the pool
    pool.execute(system);
    pool.execute(apps);
    pool.execute(documents);
   
    // Write statistics of the pool until the three tasks end
    do {
View Full Code Here

    FolderProcessor apps=new FolderProcessor("C:\\Program Files","log");
    FolderProcessor documents=new FolderProcessor("C:\\Documents And Settings","log");
   
    // Execute the three tasks in the pool
    pool.execute(system);
    pool.execute(apps);
    pool.execute(documents);
   
    // Write statistics of the pool until the three tasks end
    do {
      System.out.printf("******************************************\n");
 
View Full Code Here

    FolderProcessor documents=new FolderProcessor("C:\\Documents And Settings","log");
   
    // Execute the three tasks in the pool
    pool.execute(system);
    pool.execute(apps);
    pool.execute(documents);
   
    // Write statistics of the pool until the three tasks end
    do {
      System.out.printf("******************************************\n");
      System.out.printf("Main: Parallelism: %d\n",pool.getParallelism());
View Full Code Here

        // Create a ForkJoinPool
        ForkJoinPool pool = new ForkJoinPool();

        // Execute the Task
        pool.execute(task);

        // Write statistics about the pool
        do {
            System.out.printf("******************************************\n");
            System.out.printf("Main: Parallelism: %d\n", pool.getParallelism());
View Full Code Here

   
    // Create a ForkJoinPool
    ForkJoinPool pool=new ForkJoinPool();
   
    // Execute the Task
    pool.execute(task);

    // Write information about the pool
    do {
      System.out.printf("PeriodictskExecution: Thread Count: %d\n",pool.getActiveThreadCount());
      System.out.printf("PeriodictskExecution: Thread Steal: %d\n",pool.getStealCount());
View Full Code Here

    FolderProcessor system = new FolderProcessor("C:\\", "txt");
    FolderProcessor apps = new FolderProcessor("D:\\", "txt");
    FolderProcessor documents = new FolderProcessor("E:\\", "txt");
    // 在池中使用execute()方法执行这3个任务。
    pool.execute(system);
    pool.execute(apps);
    pool.execute(documents);
    // 将关于池每秒的状态信息写入到控制台,直到这3个任务完成它们的执行。
    do {
      System.out.printf("******************************************\n");
 
View Full Code Here

    FolderProcessor system = new FolderProcessor("C:\\", "txt");
    FolderProcessor apps = new FolderProcessor("D:\\", "txt");
    FolderProcessor documents = new FolderProcessor("E:\\", "txt");
    // 在池中使用execute()方法执行这3个任务。
    pool.execute(system);
    pool.execute(apps);
    pool.execute(documents);
    // 将关于池每秒的状态信息写入到控制台,直到这3个任务完成它们的执行。
    do {
      System.out.printf("******************************************\n");
      System.out.printf("Main: Parallelism: %d\n", pool.getParallelism());
View Full Code Here

    FolderProcessor apps = new FolderProcessor("D:\\", "txt");
    FolderProcessor documents = new FolderProcessor("E:\\", "txt");
    // 在池中使用execute()方法执行这3个任务。
    pool.execute(system);
    pool.execute(apps);
    pool.execute(documents);
    // 将关于池每秒的状态信息写入到控制台,直到这3个任务完成它们的执行。
    do {
      System.out.printf("******************************************\n");
      System.out.printf("Main: Parallelism: %d\n", pool.getParallelism());
      System.out.printf("Main: Active Threads: %d\n", pool.getActiveThreadCount());
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.