<!-- MHonArc v2.4.4 --> <!--X-Subject: [MUD-Dev] Java I/O and threads. --> <!--X-From-R13: Syvf Bbznyrf <cbznyrfNpnvc.ehgtref.rqh> --> <!--X-Date: Mon, 25 Jan 1999 07:19:12 -0800 --> <!--X-Message-Id: Pine.GSO.3.96.990125100748.20890A-100000#arrow,rutgers.edu --> <!--X-Content-Type: text/plain --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, [MUD-Dev] Java I/O and threads.</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:pomales#caip,rutgers.edu"> </head> <body background="/backgrounds/paperback.gif" bgcolor="#ffffff" text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000"> <font size="+4" color="#804040"> <strong><em>MUD-Dev<br>mailing list archive</em></strong> </font> <br> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00250.html">Previous</a> | <a href="msg00252.html">Next</a> ] Thread: [ <a href="msg00290.html">Previous</a> | <a href="msg00254.html">Next</a> ] Index: [ <A HREF="author.html#00251">Author</A> | <A HREF="#00251">Date</A> | <A HREF="thread.html#00251">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>[MUD-Dev] Java I/O and threads.</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> <LI><em>Subject</em>: [MUD-Dev] Java I/O and threads.</LI> <LI><em>From</em>: Elis Pomales <<A HREF="mailto:pomales#caip,rutgers.edu">pomales#caip,rutgers.edu</A>></LI> <LI><em>Date</em>: Mon, 25 Jan 1999 10:19:02 -0500 (EST)</LI> <LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> Hi there! I decided its about time I posted something useful! Well I hope! I have been writing a MUD server for the last few months. I have been writing it in Java. I first started with a Interpretor and my own language. But Java was way too slow (or I just could not get reasonable speed) So I threw that project out and started working on a pure Java server. The server is coming along nicely, but I have run into an issue. The current dilemma, is whether I should use threads on a per player (per socket) basis, or implement a polling loop and queue player commands, handling one command per player per loop cycle. The problem with having a thread per player is the context switching overhead. The problem with the polling loop is that I have to check each player to see if they have input. (There is no select() in Java.) Furthermore, processing one command per player may make the system very unresponsive??? Making it seem turn based? What solutions have you guys (and gals?) employed in your servers? I guess one way to use the polling loop would be to keep each command as small as possible... PS. I would still use more threads, one for NPC's and one for the game world. PSS. Is having 100+ threads really that bad? (I would think so) -- Elis Pomales pomales#dreamscape,com </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <ul compact><li><strong>Follow-Ups</strong>: <ul> <li><strong><A NAME="00254" HREF="msg00254.html">[MUD-Dev] Re: Java I/O and threads.</A></strong> <ul compact><li><em>From:</em> Jo Dillon <emily#thelonious,new.ox.ac.uk></li></ul> </UL></LI></UL> <!--X-Follow-Ups-End--> <!--X-References--> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00250.html">[MUD-Dev] Re: META: list "peerage"</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00252.html">[MUD-Dev] Re: META: list "peerage"</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00290.html">[MUD-Dev] Re: Reset Death</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00254.html">[MUD-Dev] Re: Java I/O and threads.</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00251"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00251"><STRONG>Thread</STRONG></A></LI> </UL> </LI> </UL> <!--X-BotPNI-End--> <!--X-User-Footer--> <!--X-User-Footer-End--> <ul><li>Thread context: <BLOCKQUOTE><UL> <LI><strong><A NAME="00253" HREF="msg00253.html">[MUD-Dev] Reset Death</A></strong>, Wes Connell <a href="mailto:wconnell#eden,com">wconnell#eden,com</a>, Mon 25 Jan 1999, 16:54 GMT <UL> <LI><strong><A NAME="00261" HREF="msg00261.html">[MUD-Dev] Re: Reset Death</A></strong>, Mik Clarke <a href="mailto:mikclrk#ibm,net">mikclrk#ibm,net</a>, Mon 25 Jan 1999, 20:35 GMT <UL> <LI><strong><A NAME="00269" HREF="msg00269.html">[MUD-Dev] Re: Reset Death</A></strong>, Andrew C.M. McClintock <a href="mailto:andrewm#MAIL,HSC.EDU">andrewm#MAIL,HSC.EDU</a>, Mon 25 Jan 1999, 22:27 GMT <UL> <LI><strong><A NAME="00290" HREF="msg00290.html">[MUD-Dev] Re: Reset Death</A></strong>, Mik Clarke <a href="mailto:mikclrk#ibm,net">mikclrk#ibm,net</a>, Tue 26 Jan 1999, 20:52 GMT </LI> </UL> </LI> </UL> </LI> </UL> </LI> <LI><strong><A NAME="00251" HREF="msg00251.html">[MUD-Dev] Java I/O and threads.</A></strong>, Elis Pomales <a href="mailto:pomales#caip,rutgers.edu">pomales#caip,rutgers.edu</a>, Mon 25 Jan 1999, 15:19 GMT <UL> <LI><strong><A NAME="00254" HREF="msg00254.html">[MUD-Dev] Re: Java I/O and threads.</A></strong>, Jo Dillon <a href="mailto:emily#thelonious,new.ox.ac.uk">emily#thelonious,new.ox.ac.uk</a>, Mon 25 Jan 1999, 17:19 GMT <UL> <LI><strong><A NAME="00255" HREF="msg00255.html">[MUD-Dev] Re: Java I/O and threads.</A></strong>, cynbe <a href="mailto:cynbe#muq,org">cynbe#muq,org</a>, Mon 25 Jan 1999, 18:12 GMT <UL> <LI><strong><A NAME="00257" HREF="msg00257.html">[MUD-Dev] Re: Java I/O and threads.</A></strong>, Jo Dillon <a href="mailto:emily#thelonious,new.ox.ac.uk">emily#thelonious,new.ox.ac.uk</a>, Mon 25 Jan 1999, 19:04 GMT </LI> </UL> </LI> <LI><strong><A NAME="00265" HREF="msg00265.html">[MUD-Dev] Re: Java I/O and threads.</A></strong>, Elis Pomales <a href="mailto:pomales#caip,rutgers.edu">pomales#caip,rutgers.edu</a>, Mon 25 Jan 1999, 21:39 GMT </LI> </UL> </LI> </UL> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>