April 1997
- From out of the shadows... Dan Mazeau
- Introduction Shawn Halpenny
- Introduction Nathan Yospe
- Introduction Chris Gray
- Introduction coder@ibm.net
- Introduction S001GMU@nova.wright.edu
- Introduction Jeff Kesselman
- Introduction Chris Gray
- Introduction Mik Clarke
- Introduction Caliban Tiresias Darklock
- Introduction Mik Clarke
- Introduction Caliban Tiresias Darklock
- Introduction J C Lawrence
- Introduction Elia Morling
- Event-driven? Michael Hohensee
- Event-driven? Nathan Yospe
- Event-driven? coder@ibm.net
- Event-driven? Jon A. Lambert
- Event-driven? Adam Wiggins
- Event-driven? Shawn Halpenny
- Event-driven? Chris Gray
- Event-driven? coder@ibm.net
On 03/04/97 at 03:49 PM, Michael Hohensee <michael@sparta.mainstream.net>
said:
>Precisely how does an event-driven mud work? I understand the idea, but
>I don't see how it could be run efficiently, and be coded neatly...
>Can somebody enlighten me?
Event driven eh?
In the beginning there was nothing but an endless void without
dimension.
And then there cam an event.
And the event created a change.
And then there was something.
And nothing was ever the same again.
I'll presume that you understand the basic concepts of how an event driven
system works. From there its probably easiest to detail how my system
approaches being an event driven system. The following was wrtten a while
ago:
--<cut>--
...I take an explicitily multi-threaded event driven approach. To
describe: (please excuse typo's. I have the flu, and my eyes are
burning)
The server itself knows nothing about the game it is representing. It
has
no parser, game knowedge, or anything else application specific. All it
does is represent a database.
The database consists of records. Each record defines an object in the
MUD world. An object may have attributes, methods, and verbs defined on
it.
The server is entirely event driven.
Every event executes asynchronously in its own thread using a lockless
model.
The server core consists of the following base units:
-- DB
-- Dispatchor
-- Executor
-- Connector
The Dispatchor consists of two threads which own and operate the Event
List.
The Event list contains an entry for every event which has been logged
with the system but not processed yet. Logged events are of two forms:
1) execute at XXX time, or 2) Percentage chance of execution within
time.
One thread in the dispatchor handles placement of new entries onto the
Event List. The other thread processes the list looking for "ripe"
events
(ie ones ready to be executed).
Ripe events are sent to the Executor where they are placed in an Event
Queue. The Event Queue is a priority queue with events ordered by their
own execution priority.
The Executor manages the Event pool, a local pool of threads (the number
dynamically grows and shrinks at runtime depending on load) which are
used
to execute the events pulled off the Event Queue. Threads in the Event
Pool are re-used to execute ripe events.
Events are pulled off the Event Queue in priority order and handed to
the
first available thread.
Compleated events can log futher/later events back to the Dispatchor for
subsequent animation. This is how mobiles are naimated for instance.
User IO arrives thru the Connector. The connector is essentially a
pool of threads which asynchronously manage the general pool of outside
connections. A seperate monitor is responsible for keeping the IO
network tree happy.
User commands arrive at the Connector and are immediately sent to the
Dispatchor as Execute-In-Zero-Time (ie no delay) events. The event
logged is acutally to parse the command as entered. The dispatchor
then routes the event to the Executor, it runs the event and the
resultant parse creates a new event which is logged with the Dispatchor
to actually execute the intended action.
--<cut>--
What you may note in the above, is that there are no timing loops, pulses,
heartbeats, polling (gasp!) or similar. They don't exist, and I don't
intend to let them exist. For anything to happen it must log an event
with the Dispatchor. The Dispatchor and the Executor then collude to
determine when exactly it will be executed. If there are no ripe events
demanding current execution -- the server idles, and does nothing. There
are no loops going on with the server running about in circles checking to
see if anything needs to be done, or updating status. If there are no
currently ripe evnts, the server does very very literally NOTHING. It
just sits there and blocks until an event ripens.
--
J C Lawrence Internet: claw@null.net
----------(*) Internet: coder@ibm.net
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...
- (subject missing) Dan Mazeau
- A late introduction Jon A. Lambert
- Re-Introduction S001GMU@nova.wright.edu
- New guy Walter Goodwin
- New guy coder@ibm.net
- Socket Stuff Shawn Halpenny
- database stuff Chris Gray
- So in an event-driven server, how do you ... Michael Hohensee
- So in an event-driven server, how do you ... Nathan Yospe
- So in an event-driven server, how do you ... S001GMU@nova.wright.edu
- So in an event-driven server, how do you ... Chris Gray
- So in an event-driven server, how do you ... clawrenc@xsvr1.cup.hp.com
- So in an event-driven server, how do you ... clawrenc@cup.hp.com
- Off on the languages tangent! Chris Gray
- Yet Another Introduction Reed D. Copsey, Jr.
- Yet Another Introduction Nathan Yospe
- Yet Another Introduction clawrenc@cup.hp.com
- Yet Another Introduction clawrenc@cup.hp.com
- Yet Another Introduction Adam Wiggins
- Yet Another Introduction Dmitri Kondratiev
- self-intro: Cynbe Cynbe ru Taren
- Unique id's Chris Gray
- Unique id's clawrenc@cup.hp.com
- Unique id's Jon A. Lambert
- Unique id's coder@ibm.net
- Unique id's Jon A. Lambert
- Unique id's coder@ibm.net
- Unique id's Jeff Kesselman
- Unique id's clawrenc@cup.hp.com
- Unique id's Jon A. Lambert
- Dupes are my fault (again) coder@ibm.net
- six degrees of submission ... er, compilation. Cynbe ru Taren
- six degrees of submission ... er, compilation. Jeff Kesselman
- Java as a mudserver language Cynbe ru Taren
- Java as a mudserver language Jeff Kesselman
- Execution Chris Gray
- Using system time for ObjectIDs clawrenc@cup.hp.com
- short absence Chris Gray
- short absence coder@ibm.net
- Hello! Ross Nicoll
- Ho hum (clarifiyign AI terms) Jeff Kesselman
- Ho hum Ling
- Fw: Just a bit of musing Travis Casey
- Risk Assessment -- was (Ho hum) Jon A. Lambert
- Who is Steward and what can he do for me? Jon A. Lambert
- Who is Steward and what can he do for me? clawrenc@cup.hp.com
- Who is Steward and what can he do for me? Chris Gray
- project management (or coding, kings, and other things) Jon A. Lambert
- Threads and Sockets (Was Ho hum) S001GMU@nova.wright.edu
- Threads and Sockets (Was Ho hum) Jeff Kesselman
- Threads and Sockets (Was Ho hum) S001GMU@nova.wright.edu
- Threads and Sockets (Was Ho hum) clawrenc@cup.hp.com
- Threads and Sockets (Was Ho hum) Chris Gray
- Strings & Memory Usage Greg Munt
- Strings & Memory Usage clawrenc@cup.hp.com
- Strings & Memory Usage Jeff Kesselman
- Strings & Memory Usage Shawn Halpenny
- Strings & Memory Usage ashen
- Strings & Memory Usage Chris Gray
- Steward coder@ibm.net
- r.g.m.* - worthwhile thread Nathan Yospe
- r.g.m.* - worthwhile thread clawrenc@cup.hp.com
- r.g.m.* - worthwhile thread Jeff Kesselman
- r.g.m.* - worthwhile thread Chris Gray
- (fwd) A Mud Protocol (MUD Markup Language) coder@ibm.net
- Ho hum (Sockets) Ling
- Steward and other painful friends coder@ibm.net
- A Combat System (please critique!) S001GMU@nova.wright.edu
- Your Message To mud-dev Jon A. Lambert
- I'm back Chris Gray
- Changes to the list coder@ibm.net
- Oops coder@ibm.net
- Verb binding Chris Gray
- Verb binding clawrenc@cup.hp.com
- Verb binding ashen
- Verb binding Chris Gray
- Verb binding Adam Wiggins
- Verb binding clawrenc@cup.hp.com
- Verb binding S001GMU@nova.wright.edu
- Verb binding Shawn Halpenny
- Verb binding Chris Gray
- Verb binding clawrenc@cup.hp.com
- Verb binding Chris Gray
- Why have a combat state? Jeff Kesselman
- Why have a combat state? clawrenc@cup.hp.com
- Introduction Jamie Norrish
- Introduction S001GMU@nova.wright.edu
- Introduction clawrenc@cup.hp.com
- Introduction Jeff Kesselman
- Introduction clawrenc@cup.hp.com
- Introduction Chris Gray
- Introduction Travis Casey
- Introduction Jeff Kesselman
- Introduction scherecwich@angelfire.com
- Introduction Jon A. Lambert
- Introduction Chris Gray
- (fwd) Issues from the digests and Wout's list Raz
- (fwd) Issues from the digests and Wout's list Chris Gray
- (fwd) Issues from the digests and Wout's list clawrenc@cup.hp.com
- (fwd) Issues from the digests and Wout's list Raz
- (fwd) Issues from the digests and Wout's list Chris Gray
- (fwd) Issues from the digests and Wout's list clawrenc@cup.hp.com
- (fwd) Issues from the digests and Wout's list Chris Gray
- (fwd) Issues from the digests and Wout's list clawrenc@cup.hp.com
- (fwd) Issues from the digests and Wout's list Oliver Jowett
- (fwd) Issues from the digests and Wout's list Chris Gray
- (fwd) Issues from the digests and Wout's list clawrenc@cup.hp.com
- (fwd) Issues from the digests and Wout's list Raz
- (fwd) Issues from the digests and Wout's list Miroslav Silovic
- (fwd) Issues from the digests and Wout's list clawrenc@cup.hp.com
- (fwd) Issues from the digests and Wout's list Adam Wiggins
- (fwd) Issues from the digests and Wout's list clawrenc@cup.hp.com
- (fwd) Issues from the digests and Wout's list Miroslav Silovic
- (fwd) Issues from the digests and Wout's list clawrenc@cup.hp.com
- (fwd) Issues from the digests and Wout's list Raz
- (fwd) Issues from the digests and Wout's list clawrenc@cup.hp.com
- (fwd) Issues from the digests and Wout's list clawrenc@cup.hp.com
- Me Raz
- Sendmail changes coder@ibm.net
- Reposts Adam Wiggins
- Semaphores, Mutices, fd_sets Greg Munt
- Semaphores, Mutices, fd_sets Jeff Kesselman
- Semaphores, Mutices, fd_sets clawrenc@cup.hp.com
- MUD Design Digest V1 #55 coder@ibm.net
- Me Raz
- Magnetic Scrolls' magical parser Greg Munt
- Magnetic Scrolls' magical parser clawrenc@cup.hp.com
- Magnetic Scrolls' magical parser Adam Wiggins
- Magnetic Scrolls' magical parser Nathan Yospe
- Magnetic Scrolls' magical parser Chris Gray
- Magnetic Scrolls' magical parser Ling
- Magnetic Scrolls' magical parser Chris Gray
- Magnetic Scrolls' magical parser Shawn Halpenny
- Reposts Jeff Kesselman
- Email change Alex Oren
- SUBSCRIBE Alex Oren
- (fwd) Death in Muds -(also Birth, Imprisonment, Aging, and skill development) coder@ibm.net
- fd_set limitations Greg Munt
- parsing Chris Gray