Main.java
// 3. All philosophers now get to work
3. All philosophers now get to work
3 . All philosophers now get to work
public static void main(String[] args) {
    log(N+" philosophers get to work ...");
    philosopher = new Thread[N];
    fork = new Semaphore[N];
    for(int i=0; i<N; i++) {
      philosopher[i] = philosopher(i);
      fork[i] = new Semaphore(1);
    }
    for(int i=0; i<N; i++)
      philosopher[i].start();
  }
public static void main ( String [ ] args ) { log ( N + " philosophers get to work ..." ) ; philosopher = new Thread [ N ] ; fork = new Semaphore [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { philosopher [ i ] = philosopher ( i ) ; fork [ i ] = new Semaphore ( 1 ) ; } for ( int i = 0 ; i < N ; i ++ ) philosopher [ i ] . start ( ) ; }
3.
3 .