[Questions]Events

Tim Rowledge tim at sumeru.stanford.edu
Fri Jul 28 18:42:24 UTC 2000


In message <3981527A.5488FAD2 at home.com> you wrote:
 
> Do you think there is a way to make the sockets eventful, while still
> maintaining the backwards compatibility?  It looks like the X events
> were buffered previously and there weren't any Semaphores being tapped. 
> As you know, this isn't the situation with sockets.
I'm not entirely sure I follow you, but remember that the event stuff is
currently _synchronous_ not asynchronous. So, no Semaphores are harmed
by using the events.
I did have one experimental system that used the old ST-80 idiom of a
high priority Process that waited on a semaphore signalled by the VM,
but that still required regular polling of the VM to get it to run
ioProcessEvents() since there are no interrupts provided to do that
asynchronously. I would also have to do some tedious asynchronous
signalling code somewhere in the VM, unless maybe the externalSemaphore
stuff is adequate for that already. Another big problem is that using
the interrupt key (alt-. etc) will interrupt the event loop Process as
often as not, and then you are truly screwed; can't run a UI dependent
on events when the mechanism that delivers them is halted!

IF (big if) one could rely on asynchronous event notification from the
OS, maybe through threads, signals, service calls, traps, boojums or
whatever they call'em, then we could sensibly do interrupt driven events
to the image. I just realised that a possible reason the interrupt-key
problem exists in Squeak and didn't ever seem to in ST-80 is that ST-80
handled the interrupt-key in the event loop, not with a special separate
Process/VM handler. Maybe changing that would help? Don't forget that
not all OSs provide threads - certainly a lot of interesting ones for
small and embedded systems don't (my main interests).

Trying to guess what you mean by making sockets event-driven (driving?),
I can imagine making a completed socket (or indeed asynchfile, serial,
whatever) call add an event to the event queue. I can't help thinking
that it might be tricky to arrange getting the event to the right place
though, whereas a semaphore being signalled is pretty much by definition
the right place.

Have I answered any of your original question?

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- Cursor's flashing but there's no response.





More information about the Squeak-dev mailing list