View Single Post
  #1 (permalink)  
Old 06-28-2007, 10:34 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,119
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Icon9 IllegalThreadStateException

Do anybody know why does this Exception is being thrown?

PHP Code:
public class DiningPhilosopher {
    
public static void main(String[] args) {
        
Chopstick cs = new Chopstick();
        
Philosopher p1 = new Philosopher(cscs1);
        
Philosopher p2 = new Philosopher(cscs2);
        
Philosopher p3 = new Philosopher(cscs3);
        
Philosopher p4 = new Philosopher(cscs4);
        
Philosopher p5 = new Philosopher(cscs5);
        
p1.start();
        
p2.start();
        
p3.start();
        
p4.start();
        
p5.start();
    }

I don't see there's anything wrong in my codes...

Error Message:
Code:
Exception in thread "main" java.lang.IllegalThreadStateException
	at java.lang.Thread.start(Unknown Source)
	at DiningPhilosopher.main(DiningPhilosopher.java:10)

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by HelloWorld : 06-28-2007 at 10:41 PM.
Reply With Quote