Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to synchronize these threads

 
mike Vigor
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So this is my very first java program involving threads...is a game in which there are going to be 39 rounds...and it may involve up to 8 people...at everyround
every persone must have a turn to make a move... so i implemented a sort of controller for the game using threads...but I can't even synchronize the basic stuff sic
am going to post the snippet so that the more seasoned java programmers can give a look...am going to pin point some areas with comments...


2nd part
 
mike Vigor
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved it..putting synchronized before run() and all was well
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!