New to network programming a couple questions:
So I'm making a MUD from scratch. At first it was going to be just a learning exercise but it's turning out to be a bigger task than I expected so now it's a full on project.
A couple questions about the network: is it a bad idea to make a new thread to handle each user's socket connection? I understand the main drawback with threads is their high memory use but if I specify a very small stack size (using _beginthread() on windows) wouldn't that handle that issue completely? Of course I'm coding with major success in mind so I'm planning to have my server support 1000 users at once (ridiculous I know, but better safe than sorry).
The upside for a thread for each user is that one guy with a slow connection won't slow down anyone but himself. Plus it actually seems alot simpler and more efficient than the thread pool I've implemented which has an ugly select() loop which I figure will eat up a lot of cycles.
I'm sure there is a pretty standard way to deal with connections in MUDs but I don't know lit.
|