PDA

View Full Version : Threading Sockets



xGTx
21-11-2004, 08:51 PM
Do you guys think it would be beneficial to thread sockets on a MMORPG server? What happens if you have 2 different threads for 2 different connections, and both the threads recieve a command to do the same function at the same time? Would that cause problems or can you call the same function at the same time... as long as it doesnt interfere with any global variables im guessing? I also may have heard that the INDY suite does threading for you for connections, this true? Thanks!

cairnswm
22-11-2004, 04:57 AM
Thats a rather vague question to ask. I think it all depends on how the internals of your MMOG work. If your system is threaded then yes you need to have threaded connections. If your internals run on a single thread then you mustn't let multiple instuctions into the system at the same time.

Have you ever spent time looking at Delphi's Intraweb stuff. Basically it creates a web server that supports multiple connections. Each connection actually has its own data module that stores the session information (including data connections etc). So each connection links its user into a seperate set of data (obviously all looking at the same database).