This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes send message from thread to other Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "send message from thread to other" Watch "send message from thread to other" New topic
Author

send message from thread to other

Mohamad Samy
Ranch Hand

Joined: Apr 26, 2013
Posts: 98
I have the following code to check the winner of the TicTacToe game, when any condition within is satisfied (for example here is first condition at line 8 ) I could send the current player a message with his result either he won or lost but I can't give the result of the game to the other player as I am in the current player thread, how could I do this.
I tried to switch to the other player through
but that don't work either
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

None of that code should be sending any messages to the other player. The caller of that method is the one who should be sending such a message, if the method returns true. Pseudocode:


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: send message from thread to other
 
Similar Threads
SoDuko puzzle
Changes to Tic Tac Toe Game?
Tic-tac-toe Design
Game Programming Problem! J2ME
synchronization.. and threads !!!