Hi,
I'm currently working on a modification for the Half Life 2 engine, one
of the features in this project is that the server will query a master
database on our web server and cross reference player names and IDs to
see if they are suscribers to our "Regulars" program. Long story short,
the game server cannot afford to "freeze" every so often to perform an
SQL query.
I've ran some test apps with mysql++ building with MSVC++ 2003 and the
library it uses for debugging is the multi-threaded library, so I
assumed that mysql++ ran it's code in a seperate thread, but i don't
have... any experience with multi-threading besides some theory in a
recent college course on process handling, so my question is, do i need
to create a separate function that handles all my updating code for the
list of "Regulars" currently on the server and run that as a separate
thread (but then I will have to worry about mutexes and other such
unfamiliar things to me) or is there some way for me to just call an
UpdateDatabase() function of sorts without fear that the query will
"freeze" my server?
Another option was to start up the connection to the database when the
server loads and keep it alive all throughout the duration of a round,
but I think that would be a cheap and wrong way to do it...
Thanks in advance
Imperio59 a.k.a Florian Laplantif
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.6.1 - Release Date: 04/03/2005