[MUD-Dev] CORBA, RMI, threads

Marc Eyrignoux Marc.Eyrignoux at efrei.fr
Fri Jan 23 12:30:47 CET 1998


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.
The aim is to
have efficient and quick communications, it doesn't matter for me if the
programing
is less easy.
- If I have a telnet client and a java serveur (or a java client and a
C++ serveur), 
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
* the use of a multi-threaded database like postgreSQL or mySQL, which
libraries are
already threaded
* a thread for the time (in my mud, 3mn_real_life=1h_mud_life)
* a mecanism based upon thread for the event handler.
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?
+ are NPCs threads in your servers? or is there something like
while (1)
{ 
	getTheListOfActiveMonsters();
	for (monster = firstMonster(); monster = lastMonster(); monster++)
		{ 
		monster.act();
		}
}
In the case monsters are threads, do you need to stock somewhere the
list of active monsters?
In this case, is there an accurate way of stocking them?
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?
have you programed that kind of things?)
+ 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);
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?
		   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.



More information about the mud-dev-archive mailing list