<!-- MHonArc v2.4.4 --> <!--X-Subject: Re: [MUD-Dev] CORBA, RMI, threads --> <!--X-From-R13: @nguna Kbfcr <lbfcrNunjnvv.rqh> --> <!--X-Date: Fri, 23 Jan 1998 18:58:53 +0000 --> <!--X-Message-Id: Pine.GSO.3.95q.980123082656.12727B-100000@uhunix1 --> <!--X-Content-Type: text/plain --> <!--X-Reference: 34C87F67.41C67EA6#efrei,fr --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, Re: [MUD-Dev] CORBA, RMI, threads</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:yospe#hawaii,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="msg00299.html">Previous</a> | <a href="msg00301.html">Next</a> ] Thread: [ <a href="msg00443.html">Previous</a> | <a href="msg00323.html">Next</a> ] Index: [ <A HREF="author.html#00300">Author</A> | <A HREF="#00300">Date</A> | <A HREF="thread.html#00300">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>Re: [MUD-Dev] CORBA, RMI, threads</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI> <LI><em>Subject</em>: Re: [MUD-Dev] CORBA, RMI, threads</LI> <LI><em>From</em>: Nathan Yospe <<A HREF="mailto:yospe#hawaii,edu">yospe#hawaii,edu</A>></LI> <LI><em>Date</em>: Fri, 23 Jan 1998 08:58:24 -1000</LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> On Thu, 22 Jan 1998, Marc Eyrignoux wrote: :Hello :I apologize for not saying very much on the list, but I don't think I :would :be helpful for anybody. :I have some questions that I couldn't solve by myself, even by rereading :all :the mails on the subject: :- If I chose to use CORBA or RMI for the communications between the :clients and :the serveur, I am afraid the generated traffic will be too important. Speaking of which, someone (Chris L, I think) once posted several CORBA URLs. I'd like to see them again, if you could grep the archives, please? :The aim is to :have efficient and quick communications, it doesn't matter for me if the :programing :is less easy. I've doing client-server communications right now, both for my mud and professionally. I think the first couple things that catch my eye are: :- If I have a telnet client and a java serveur (or a java client and a :C++ serveur), telnet client? Er... are you doing text output? And how much of the protocol are you implementing? Whatever the case, if you do this, you haven't really any need for Corba or RMI. And you are NOT getting what you say you want. As for C++ server/Java client... RMI will work, CORBA will too, from what I can see so far. Custom interfaces are also good. I'm using a lot of rpc generated code for these... :is it possible to use RMI? I know CORBA is programed on both platforms. :- I intend to have a multi-threaded serveur, as the mails on the list :seemed to :prove it was the best way to program the evenemential part of the code. :So my projects :are: :* one thread per connection, for listening Usually a good idea. You might want to look into thread containers that are capable of checking threads in and out of a pool as well. :* the use of a multi-threaded database like postgreSQL or mySQL, which :libraries are :already threaded Hmm. Databased mud. *frown* Am I the only guy here who thinks this is bad design? :* a thread for the time (in my mud, 3mn_real_life=1h_mud_life) Whoa, whoa, whoa! What? Er... I think you'll find you are a lot better off coordinating with a system clock or somewhat, instead of trying to make a clock thread (which will go asynchronous, and screw you up royally.) :* a mecanism based upon thread for the event handler. OK. This'll take a lot more thought, but its the right way to go, IMO. :So they are 3 points I would like to get clearer: :+ even if the functions given in the database library are multithreaded, :do I need to :thread the functions that call them? Not quite reading you here. How are you storing functions in the database? :+ are NPCs threads in your servers? or is there something like :while (1) :{ : getTheListOfActiveMonsters(); : for (monster = firstMonster(); monster = lastMonster(); monster++) : { : monster.act(); : } :} NO! Then again... I use a "locational" heirarchy for both storage of references (OK, I confess, there is a database or five on the client side, and a sort of a database on the server for error checking.) and for my event/thread system. This means that each player becomes the center of a flury of activity (observer triggered resolution of quantum states. No, really, that was my model, and I think I've actually managed to satisfy it for an optimal solution to a lot of concurency issues, not to mention process concerns.) which controls the behavior of any NPCs and other objects in the player's heirarchy. :In the case monsters are threads, do you need to stock somewhere the :list of active monsters? Well, even in my system, instatiated (as opposed to potential) objects DO have to be tracked. :In this case, is there an accurate way of stocking them? Hash table of instances, an instance is a collection of references to a client-side database coupled with a server-side physical model and behavior model. You won't find better than a well implemented hash table, believe me I tried. Dynamic trees are the next best thing. :In fact, I intend to make the monsters act every 15 seconds. A thread :that would sleep for 15 :seconds and acts according to the situation at the moment it wakes up :seems to be a good way :for doing this. But I forget the case when the monster has to know :something that happened :while it was sleeping. The question is: do I have to set in place a :mecanism that warns the monster, :or isn't it obliged? (in fact my question is: are monsters in your muds :intelligent or not? Oh, yes, they are quite intelligent. Of course, I don't have any of this fifteen second sleep thing... and my _denizens_, whatever the form, are rarely instantiated unless there is a player around. They often borrow some of their intelligence from players. I've posted on this before. :have you programed that kind of things?) Depends... :+ I have read the structure of the event handler of people who explained :them. :In the case of an event queue, you stock the events in a structure :handled by a class. :But this class has to do something like :while (1) :{ : getTheMostUrgentEvents(); : executeEvent(); : rescheduleOtherEvents(); :} :Isn't it a lost of cpu time compared to: :thread.sleep(n); Yes and no. It is a lot easier on other resources, and thread.sleep(n) uses a little bit of cpu that you won't see obviously. After all, it is usually implemented as an event queue itself, or something similar. (stack queue) It also makes a tremendous difference HOW you implement synchronization (Or at least conflict resolution) between threads. I actually have a built in mechanism that avoids the dragon's dinner problem altogether, at the occasional cost of a little speed (but not much.) This lets me avoid ever having to reschedule failed events. :But in the case of totally threaded events, you have to create them, :stock them in order to interrupt :them. 2 questions: is there a thread per possible event? is there a :generic class eventThread which :may contain any event? In this case, is there an accurate way of :programing it? Er... bad idea. You don't want your OS to choke on the threads; a lot of Unix's will. Solaris and IRIX, for example... : once again, is there an intelligent way of stocking threads? I :thing about a :hashtable which value would be the thread, but what would be the key? :Thanks in advance. This, I can't answer. -- "You? We can't take you," said the Dean, glaring at the Librarian. "You don't know a thing about guerilla warfare." - Reaper Man, Nathan F. Yospe Registered Looney by Terry Pratchett yospe#hawaii,edu <A HREF="http://www2.hawaii.edu/~yospe">http://www2.hawaii.edu/~yospe</A> Meow </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="00323" HREF="msg00323.html">Re: [MUD-Dev] CORBA, RMI, threads</A></strong> <ul compact><li><em>From:</em> Marc Eyrignoux <Marc.Eyrignoux#efrei,fr></li></ul> </UL></LI></UL> <!--X-Follow-Ups-End--> <!--X-References--> <UL><LI><STRONG>References</STRONG>: <UL> <LI><STRONG><A NAME="00293" HREF="msg00293.html">[MUD-Dev] CORBA, RMI, threads</A></STRONG> <UL><LI><EM>From:</EM> Marc Eyrignoux <Marc.Eyrignoux#efrei,fr></LI></UL></LI> </UL></LI></UL> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00299.html">RE: [MUD-Dev] Graphical mud perspectives</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00301.html">Clients based on Netscape 5?</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00443.html">Re: [MUD-Dev] CORBA, RMI, threads</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00323.html">Re: [MUD-Dev] CORBA, RMI, threads</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00300"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00300"><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>[MUD-Dev] CORBA, RMI, threads</STRONG>, <EM>(continued)</EM> <ul compact> <ul compact> <ul compact> <ul compact> <LI><strong><A NAME="00293" HREF="msg00293.html">[MUD-Dev] CORBA, RMI, threads</A></strong>, Marc Eyrignoux <a href="mailto:Marc.Eyrignoux#efrei,fr">Marc.Eyrignoux#efrei,fr</a>, Fri 23 Jan 1998, 11:30 GMT <UL> <LI><strong><A NAME="00294" HREF="msg00294.html">Re: [MUD-Dev] CORBA, RMI, threads</A></strong>, Vadim Tkachenko <a href="mailto:vadimt#4cs,com">vadimt#4cs,com</a>, Fri 23 Jan 1998, 15:39 GMT <UL> <LI><strong><A NAME="00307" HREF="msg00307.html">Re: [MUD-Dev] CORBA, RMI, threads</A></strong>, Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Sun 25 Jan 1998, 03:32 GMT <UL> <LI><strong><A NAME="00443" HREF="msg00443.html">Re: [MUD-Dev] CORBA, RMI, threads</A></strong>, coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Thu 12 Feb 1998, 22:22 GMT </LI> </UL> </LI> </UL> </LI> <LI><strong><A NAME="00300" HREF="msg00300.html">Re: [MUD-Dev] CORBA, RMI, threads</A></strong>, Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Fri 23 Jan 1998, 18:58 GMT <UL> <LI><strong><A NAME="00323" HREF="msg00323.html">Re: [MUD-Dev] CORBA, RMI, threads</A></strong>, Marc Eyrignoux <a href="mailto:Marc.Eyrignoux#efrei,fr">Marc.Eyrignoux#efrei,fr</a>, Mon 26 Jan 1998, 16:40 GMT <UL> <LI><strong><A NAME="00324" HREF="msg00324.html">CORBA, RMI, threads</A></strong>, s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Mon 26 Jan 1998, 20:37 GMT </LI> <LI><strong><A NAME="00331" HREF="msg00331.html">Re: [MUD-Dev] CORBA, RMI, threads</A></strong>, Brandon Gillespie <a href="mailto:brandon#roguetrader,com">brandon#roguetrader,com</a>, Tue 27 Jan 1998, 21:26 GMT <UL> <LI><strong><A NAME="00334" HREF="msg00334.html">Re: [MUD-Dev] CORBA, RMI, threads</A></strong>, Marc Eyrignoux <a href="mailto:Marc.Eyrignoux#efrei,fr">Marc.Eyrignoux#efrei,fr</a>, Wed 28 Jan 1998, 10:09 GMT </LI> </UL> </LI> </UL> </LI> </UL> </LI> </UL> </LI> </ul> </ul> </ul> </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>