I am using shared group data for online game storage in a turn based game. The way the game works is that for each turn when all players have submitted their moves we process the turn end and send the results to the clients.
The issue is if 2 players (or more) submit at the same time causing a concurrent request. I am trying to minimize the amount of api/data requests to the playfab api so all the turn data is loaded at the start of the request.
To this end it creates a race where neither request notices that the turn should be completed now. Normally I would solve this with some sort of mutex or critical section but this doesnt seem to be available in cloudscript.
What is the recommended way to solve this?