Re: exported.writes inside a hook threadlock?

will guaraldi <[email protected]>
Newsgroups gmane.comp.games.mud.client.lyntin
Message-ID <[email protected]>
On Mon, 12 Apr 2004, Eugene wrote:
>
> On Mon, 12 Apr 2004 11:29:13 -0500 (CDT) will guaraldi wrote:
>
> >its own event.  The problem with using this is that the output to the
> >user happens after all the events prior to the OutputEvent have been
> >handled--so it's serialized but out of order in respect to what
> >happened.
>
> Yes, it will be serialized, but are you sure it is a problem? For me,
> the UI output looks naturally as a low-priority event (as it is in many
> UI toolkits), so it's serialization is probably ok.

The serialization is fine--it's the order that's the issue.  If I was a
user, I'd want to see things happening when they were happening, not get a
notification long after the fact.

Case in point, say we had the following events in the queue:

2. MudEvent:  Tomas kicks you.
1. UserEvent: #action {%1 kicks you} {kick %1}


We handle the UserEvent creating the action.  Then we handle the MudEvent
where the action gets triggered.  Would you rather the output be like
this (where the most recent output is at the bottom):

"""
Tomas kicks you.
You kick Tomas.
lyntin: action {%1 kicks you} {kick %1} added.
"""

where things are out of order (the action was really created before we
kicked Tomas) display-wise or like this:

"""
lyntin: action {%1 kicks you} {kick %1} added.
Tomas kicks you.
You kick Tomas.
"""


I prefer the latter--reading a log of it certainly makes more sense.
There are some cases where an OutputEvent makes a lot of sense, but I
think in general, it's better to display the output as things are
happening rather than queueing it to the end of the event queue.

Now, we could have a priority event queue where all user events get cycled
to the top immediately which then allows all display to the user things to
happen as an event and still maintain the order of notices to the user (I
think that's true).  That would be interesting to explore further.

/will


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.