I'm working for a multiplayer game, I record events in MySQL database without blocking the game update thread Want to So that if the database is busy or there is a table lock then the game does not stop running, while it waits for one to write.
What is the best way to accomplish this?
Using c3p0 for managing database connection pools. My best idea of up to now is to add query update strings only to a synchronized list, in which the list of every 100ms is to check an independent thread and execute the query that gets there.
This sounds good to me if you do not want to block your main thread, Except that the synchronized list and 100 MMS votes Do not use donations, but use some implementation instead. It should work, if you disassociate it, it will never block your main thread.
Comments
Post a Comment