Advertisement
crownedzero

MP3_2

Nov 15th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.09 KB | None | 0 0
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package mp3_2;
  6.  
  7. import domain.Consumer;
  8. import domain.Producer;
  9.  
  10. /**
  11.  *
  12.  * @author crownedzero
  13.  */
  14. public class Mp3_2 {
  15.  
  16.     /**
  17.      * @param args the command line arguments
  18.      */
  19.     public static void main(String[] args) {        
  20.        
  21.         ThreadGroup producerGroup = new ThreadGroup("Producers");
  22.         Thread t0 = new Thread(producerGroup, new Producer(), "EastCoastOriginals");
  23.         Thread t1 = new Thread(producerGroup, new Producer(), "WestCoastCustoms");
  24.         t0.start();
  25.         t1.start();
  26.        
  27.         ThreadGroup consumerGroup = new ThreadGroup("Producers");
  28.         Thread t2 = new Thread(consumerGroup, new Consumer(), "Eastern");
  29.         Thread t3 = new Thread(consumerGroup, new Consumer(), "Central");
  30.         Thread t4 = new Thread(consumerGroup, new Consumer(), "Mountain");
  31.         Thread t5 = new Thread(consumerGroup, new Consumer(), "Pacific");
  32.         t2.start();
  33.         //t3.start();
  34.         //t4.start();
  35.         //t5.start();
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement