View Single Post
  #2 (permalink)  
Old 06-28-2007, 11:35 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
I just fix the problem The problem is that I cannot use Thread twice, that's why I would need to use implements Runnable on my Philosopher's class. and then creates:

Code:
Philosopher p1 = new Philosopher(cs, cs, 1);
Philosopher p2 = new Philosohper(cs, cs, 2);
// and so on until p5
// and then...
Thread t1 = new Thread(p1);
t1.start();
Thread t2 = new Thread(p2);
t2.start();
// and so on.. up to 5
// it works pretty good!
// need to be tested over time now to see if there's bugs
Thanx all who supported me ccoonen (is that how you spell it?) this is from the top of my head, and the rest of PT teams.. thanx for this forum so that I can post my problems.. haha... I'll post the solution right after I turned in my homework, need some checks for now...

__________________

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!
Reply With Quote