[ENH] OS-level events

Peter Smet peter.smet at flinders.edu.au
Thu Jul 1 07:59:10 UTC 1999


>> Why can't low and high level events share the same abstractions,
>> and even be placed on the same event queue? I also think
exception-handling
>> has much in common with event handling (on: exception do: aBlock). The
>> exception looks to me very much like an 'event' that the block is told
>> about. Is it possible to fuse these three mechanisms into a common
>> abstraction and reuse a lot of the code, or is this just wishful thinking
on
>> my part?

David M. Siegel wrote:
>
>I'm afraid it's wishful thinking.
>
>Events are delivered asynchronously. The event generating process is
normally
>not the one that receives the event.
>
>Exceptions should be delivered synchronously, to the same process that
raised
>the exception, with access to the context at the point where the exception
was
>raised.
>
>Updates (subscriptions) could be delivered asynchronously, but that's not
the
>Smalltalk tradition. Quite a bit of Smalltalk code assumes that updates are
>handled immediately after they're generated, before the generator executes
>the next line of code.
>

Thanks for pointing that out. Now that you have, I'm curious about the last
part. Since an object makes such minimal assumptions about dependents, why
is update synchronizing so important?. A model shouldn't even really know
whether it has 0, 1 or more views, so why does it care about their update
times? I can see from an extreme viewpoint that a 2 hour update delay could
cause problems with views not representing their models correctly. However,
if the view contents had the same (asynchronous) timing as mouse and
keyboard events, I don't see a problem. You could get situations where the
view did not represent the model quite accurately, but since they are meant
to be 'loosely coupled' (whatever that means) this should not (in theory)
cause devastating effects. When I get a bit of time I might get Stephen's
asynchronous messaging stuff, attempt to plug it into my PostOffice, and see
which things stuff up. With the exceptions, there doesn't seem any way this
could be done asynchronously (without serious effects on program
reliability), but I will go away and have a think about that too. Maybe if
exceptions were given the right priority in the event and thread queue
things could hang together???

Peter





More information about the Squeak-dev mailing list