Crusader Posted October 31, 2008 Share Posted October 31, 2008 Would using an "UPDATE LOW_PRIORITY" have any negative effects on a game? I'm storing user positions in the database and updating their row whenever they move to a different area (which would be a lot). UPDATE LOW_PRIORITY `players` SET `sector` = ?, `galaxy` = ?, `x` = ?, `y` = ? WHERE `game` = ? AND `player_id` = ? LIMIT 1 Before calling that statement this is initially run at the start of every page. SELECT * FROM `players` WHERE `user_id` = ? AND `game` = ? LIMIT 1 Would this result in nobody being able to move until someone else has completed theirs? I don't want that to happen and am not sure how to test this. ??? Note: I believe table locking is set to off on mysqld. Quote Link to comment https://forums.phpfreaks.com/topic/130826-solved-gaming-and-update-low_priority/ Share on other sites More sharing options...
fenway Posted October 31, 2008 Share Posted October 31, 2008 Well, have you read the refman page on LOW_PRIORITY/ Quote Link to comment https://forums.phpfreaks.com/topic/130826-solved-gaming-and-update-low_priority/#findComment-679433 Share on other sites More sharing options...
Crusader Posted October 31, 2008 Author Share Posted October 31, 2008 Well that's where I learned about LOW_PRIORITY but it wasn't quite clear to me whether or not it would leave users in limbo until everyone else had finished moving/updating. Quote Link to comment https://forums.phpfreaks.com/topic/130826-solved-gaming-and-update-low_priority/#findComment-679705 Share on other sites More sharing options...
fenway Posted November 3, 2008 Share Posted November 3, 2008 It's only "low" when compared to SELECT statements. Quote Link to comment https://forums.phpfreaks.com/topic/130826-solved-gaming-and-update-low_priority/#findComment-681424 Share on other sites More sharing options...
Crusader Posted November 5, 2008 Author Share Posted November 5, 2008 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/130826-solved-gaming-and-update-low_priority/#findComment-682726 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.