lurking signals in EventSensor

Andreas Raab andreas.raab at gmx.de
Thu Jul 3 16:40:50 UTC 2003


> Why 500 ms?  You can check from ioProcessEvents() and get them much
> more frequently. 

But ioProcessEvents get only called every 500ms unless you query explicitly.
Which is exactly what stimulating the input semaphore does.

> Does that function really only get called every 500 ms?
> That would be a problem on single-threaded VM's, e.g. for 
> sound buffering.

Huh? What has sound buffering to do with how often ioProcessEvents gets
called?

> By the way, these messages I'm posting are not theoretical.  They are
> closely based on an actual implementation from a few years ago that
> predates the current one.  It really does work, even if the user is
> switching between Morphic and MVC.  I'm pretty sure I only checked for
> events in ioProcessEvents() and in the input primitives themselves.

We're mixing up a few independent discussions here. If you _do_ in fact
query a primitive which calls ioProcessEvents() then you're right. However,
notice that John's proposed solution did _not_ query ioProcessEvents but
rather relied on it being called from "somewhere else" (namely from a
different thread). In a single-threaded VM this solution will only update
the input state every 500ms.

> But also, polling Sensor should be a fine thing to do. 
> One of the selling points of Squeak at Georgia Tech is that
> students are in control and that things they think will work,
> do work.  In fact, it's not uncommon for them to write GUI code
> manually, where they watch the Sensor and update things
> on Display as appropriate.  The goal is not *only* to have Morphic
> be happy, but  -- at least for us -- to have a simple and 
> comprehensible system.

Sure - the problem is not the polling of sensor but the difference in
assumptions of how events are handled. If you mix up the notions of Morphic
with that of MVC you're going to run into trouble. Note that we added
buffered event support to address a real problem - namely that of missing
events (such as clicks) due to polling delays. The problem with accessing
Sensor directly is that it interferes with some deep notions of Morphic. If
you write your own UI framework you are free to do whatever you want but if
you want to play within the existing framework then you better agree on the
rules.

Cheers,
  - Andreas



More information about the Squeak-dev mailing list