13.05.2013, 12:32
Quote:
OK, I have a few new points.
1) You could really do with more Mutexes IMHO. Currently if "ProcessQueryThread" is running, "sql_query" (and probably other natives, I've not looked) will hang until all pending queries are complete, making multiple threads almost pointless in that case. Or instead of mutexes a lock-free single producer/single consumer list implementation (I'm know these exist). In short, the mutexes are held by a thread for FAR too long. Edit: http://www.boost.org/doc/libs/1_53_0.../lockfree.html 2) On a similar note, even non-threaded queries currently obtain the Mutex and thus wait for pending operations when there's no need for them to enter a protected section at all. |
When the server crashes the queries are discarded anyway. I was thinking on creating a new native (something like mysql_wait) which would block the execution of the script until all sql queries have been executed. (Very useful if you use threaded queries to save data in OnGameModeExit)