Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Java threads and synchronization
#9
[MENTION=801]Jedward[/MENTION]; Did you figure this out? You just need to figure out when threads need to wait and when they need to notify another thread.

Dealer/CardGame/Main thread: Notify players when it's their turn. Wait during their turn.
Player: Wait when it's not my turn. Notify dealer when my turn is over.


Also there's an extra semicolon in Player.removeCard()
Code:
if(!(hand.remove(temp)));
Reply


Messages In This Thread
Java threads and synchronization - by Jedward - 2014-02-20, 08:49 PM
Java threads and synchronization - by Locked - 2014-02-20, 09:05 PM
Java threads and synchronization - by Jedward - 2014-02-20, 09:09 PM
Java threads and synchronization - by Locked - 2014-02-20, 09:17 PM
Java threads and synchronization - by Jedward - 2014-02-20, 09:45 PM
Java threads and synchronization - by Locked - 2014-02-20, 09:59 PM
Java threads and synchronization - by Jedward - 2014-02-20, 10:08 PM
Java threads and synchronization - by Locked - 2014-02-20, 10:09 PM
Java threads and synchronization - by happylight - 2014-02-25, 07:07 PM
Java threads and synchronization - by Jedward - 2014-02-27, 08:06 PM
Java threads and synchronization - by happylight - 2014-02-28, 10:02 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)