Multi-threaded Mud
Hello, I''m trying to write a multi-threaded MUD server for a linux server and using pthreads. Anyway, I was trying to figure out what exactly I should have threads for. I figure that a thread for each connected player is too much overhead. I''m thinking of using a thread for each of the following:
Monitoring Listenning socket
monitoring player connections(one thread for the all the players)
timer
NPCs(one thread for all of them)
Handling player commands
Any ideas/suggestions/advice?
/*Joe DiMichele C/C++/VB Programmer, A+ Certified Technician AIM:Krawling Khaos, ICQ:332871787 joedimichele@hotmail.com oderint dum metuantExcuse my spelling, programmers can't spel*/
May 26, 2003 11:52 AM
One thread per npc, ahahah good luck because on my last mud (which I was the owner/coder), you would have threads by the thousands.
If I would include threads in a mud that would be strictly for writing/reading from files. Like this I could make the mud save every 15 minutes without annoying the players too much. Otherwize I don''t see the point of having threads in a mud... unless maybe you got some sort of huge wilderness with AI creating towns and such in which case i''d try to allocate a thread for that too since it would require quite a lot of work.
Muds simply don''t need to be multithreaded. You will get in more troubles than it is worth implementing them.
Good Luck.
If I would include threads in a mud that would be strictly for writing/reading from files. Like this I could make the mud save every 15 minutes without annoying the players too much. Otherwize I don''t see the point of having threads in a mud... unless maybe you got some sort of huge wilderness with AI creating towns and such in which case i''d try to allocate a thread for that too since it would require quite a lot of work.
Muds simply don''t need to be multithreaded. You will get in more troubles than it is worth implementing them.
Good Luck.
I wasn''t planning one thread per NPC, I was planning one to handle all of them. I know that muds don''t need to be multithreaded, but I want to write one anyway(it''s between semesters, I need something to do) Anyway, the saving thread is an excellent idea! Interesting wilderness idea too. Thanks
/*Joe DiMichele C/C++/VB Programmer, A+ Certified Technician AIM:Krawling Khaos, ICQ:332871787 joedimichele@hotmail.com oderint dum metuantExcuse my spelling, programmers can't spel*/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement