View Single Post
Old 09-17-2010, 07:24 PM   #1
ForeverNoobie
New Member
 
Join Date: Sep 2010
Posts: 7
ForeverNoobie is on a distinguished road
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.
ForeverNoobie is offline   Reply With Quote