How to implement events on Unix?
Marcel Weiher
marcel at metaobject.com
Sun Feb 11 13:19:39 UTC 2001
> At 23:42 08.02.01 -0800, Raab, Andreas wrote:
> >Well, from my point of view I'm just *way* more interested in personal
> >computing, media authoring and education. I don't think it's a
bad sign
> >that Squeak doesn't qualify as application server ;-)
>
> Andreas, allow me to rant a bit on that statement. I think, it's
fine if
> *you* only need a CPU-cycle-hungry desktop-centric
graphical-playground
> application.
We have two usage patterns here:
1. Fully active, multi-media, power-hungry etc.
2. Passive, server-like, quick-response without active-polling
It should be possible to do both.
The question is *how* to do both. My suggestion is that it is a
*lot* simpler to add 'active-ness' to a system like (2) than it is to
try to 'passivate' a system like (1).
To passivate an active system, you have to yield the CPU at
opportune moments (with strange and difficult to tune sleep-factors),
introduce semaphores and deal with timing problems, add a
requirement for multi-threadedness in order to have somewhat
manageable code etc.
To activate a fully passive system, you just add a single loop around it:
while (1) {
let_my_passive_system_run_again();
}
Of course, the problem right now is that what we have is an active
system, so the cost of removing assumptions of activeness must also
be factored in (especially difficult for MVC, which may just have to
require 'activation' of the VM to run).
Marcel
More information about the Squeak-dev
mailing list
|