Package thread.concurrencyCookbook.chapter6.recipe07

Examples of thread.concurrencyCookbook.chapter6.recipe07.TaskLocalRandom


   
    /*
     * Launch three tasks
     */
    for (int i=0; i<threads.length; i++) {
      TaskLocalRandom task=new TaskLocalRandom();
      threads[i]=new Thread(task);
      threads[i].start();
    }

  }
View Full Code Here


     * Create and launch five Task objects
     */
    Thread threads[]=new Thread[5];
    for (int i=0; i<threads.length; i++) {
      logger.log(Level.INFO,"Launching thread: "+i);
      Task task=new Task();
      threads[i]=new Thread(task);
      logger.log(Level.INFO,"Thread created: "+threads[i].getName());
      threads[i].start();
    }
   
View Full Code Here

TOP

Related Classes of thread.concurrencyCookbook.chapter6.recipe07.TaskLocalRandom

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.