MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] Event handling (was: request for comments)
On Mon, 12 Jan 1998 07:43:01 PST8PDT
s001gmu <s001gmu#nova,wright.edu> wrote:
> On Sun, 11 Jan 1998, JC Lawrence wrote:
>> Note: "event" is actually a very poor term for what we are
>> describing here. They really aren't events, but I'm unsure of a
>> better name for them.
> Actions?
Hurm. Not bad.
>> Certainly. You create an event chain (as above) which iteratively
>> saps the character's strength and vitality. Should that process
>> happen to kill the character (strength == 0?) then this will be
>> noticed by the normal methods of the character object (probably in
>> the accessor for the strength attribute) and processed from there.
> As I understand it, the only difference is that he shortcuts the
> event chain by having the running thread (process in his terms)
> handle all of the delays by going to sleep, rather than scheduling a
> new event to go off X ticks down the road.
> There are some advantages to doing it that way... You can have the
> thread sleep by using pthread_cond_timedwait (assuming you are using
> posix threads) , and use the condition var as an interrupt signal,
> allowing for very gracefull interruption and interrupt handling. If
> you want to interrupt a pending event in an event queue, you have to
> search the queue, or have some kludgy structure imposed above the
> queue to allow for easier access, etc.
There is a significant implication in this system however. It
effectively requires that you use a locking model, as to not use a
locking model would have most sleeping threads fail due to other more
rapidly commiting threads interfering with their data references.
Conversely, if you do go for a locking system the problem is then
preventing the system from bogging down to a worse-than serial
execution case as the events all contend and lock-wait for shared
data.
--
J C Lawrence Internet: claw#null,net
Internet: coder#ibm,net
----------(*) Internet: jc.lawrence#sun,com
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...
- Thread context:
- Re: [MUD-Dev] Event handling (was: request for comments), (continued)
- Re: [MUD-Dev] Event handling (was: request for comments),
Vadim Tkachenko vadimt#4cs,com, Fri 09 Jan 1998, 23:03 GMT
- Re: [MUD-Dev] Event handling (was: request for comments),
JC Lawrence claw#under,Eng.Sun.COM, Sun 11 Jan 1998, 21:09 GMT
- Event handling (was: request for comments),
s001gmu s001gmu#nova,wright.edu, Mon 12 Jan 1998, 14:41 GMT
- [MUD-Dev] Event handling - some definitions,
Jon A. Lambert jlsysinc#ix,netcom.com, Tue 13 Jan 1998, 00:55 GMT
- Re: [MUD-Dev] Event handling (was: request for comments),
JC Lawrence claw#under,Eng.Sun.COM, Fri 16 Jan 1998, 04:31 GMT
- Event handling (was: request for comments),
s001gmu s001gmu#nova,wright.edu, Fri 16 Jan 1998, 15:35 GMT
Re: [MUD-Dev] Event handling (was: request for comments),
JC Lawrence claw#under,Eng.Sun.COM, Sun 11 Jan 1998, 20:44 GMT
[ Other Periods
| Other mailing lists
| Search
]