How to implement events on Unix?
Stefan Matthias Aust
sma at 3plus4.de
Thu Feb 8 21:46:37 UTC 2001
Andreas,
thank you for your explanations. Being away from the list for a couple of
weeks, I probably expected too much from the event stuff than currently is
implemented. At least, no clicks are lost anymore.
I know very well, that omitting polling is difficult - especially if it has
to be done in an platform independent way, but that's still not a real
excuse ;-)
I'm glad that something happened to squeak but if it doesn't mutate into
something that will not eat up CPU resources when being idle, I
unfortunately cannot use it for server applications as I really would have
liked. (A Java VM has this feature, so I know it can be done.)
>Since almost all VMs currently use a single thread for running both,
>interpret() and the event processing loop, we have to be OUT OF
>INTERPRET() in order to receive an event.
So we should use two threads. I thought, the event semaphore was
introduced for exactly that reason.
>Understood so far?!
No problem. Keep going :-)
> > And what's about sockets or serial port? Are they still
> > polled or will they also use events?
>
>They're still polled. The key issue in the VM event stuff was not loose
>user input events anymore.
I see. Actually I think it's also important that sockets signal
events. When using Swiki I noticed that there was a noticable difference
in the response time whether my mouse was inside the Squeak window or not.
I think, when I didn't provide input events to the VM, the VM tried to be
nice to the system and went into delay mode. This unfortunately also means
that sockets are polled less often and so the response time of the swiki
goes up.
However, it's absolutely no way to simply go into "fast" mode and let
Squeak burn all processor cycles, never going to sleep. Squeak already
need too many processing power for a server which is used cooperatively
when doing delays.
Again, Java has the better features here and I really hate that! I'd like
to promote Squeak as an application server but this is impossible right now.
bye
--
My eyes adapted to the darkness... finally I can see clearly now
More information about the Squeak-dev
mailing list
|