I\'m modelling a game where multiple players (threads) move at the same time. The information of where a player is located at the moment is stored twice: the player has a variab
Reading all your answers, I tried to apply the following design:
I think 1. avoids deadlocks and 3. is important as things could change while a player waits.
Further I can go without locking fields as in my game more than one player can stay at a field, only for certain threads an interaction has to be done. This interaction can be done by synchronising players - no need to sync fields...
What do you think?