[squeak-dev] Squeak on a cellphone may need better blocking behavior

Vanessa Freudenberg vanessa at codefrau.net
Wed Sep 2 01:27:23 UTC 2020


On Tue, Sep 1, 2020 at 8:36 AM Eliot Miranda <eliot.miranda at gmail.com>
wrote:

> Hi Tony,
>
>
> > On Sep 1, 2020, at 6:50 AM, Tony Garnock-Jones <
> tonyg at leastfixedpoint.com> wrote:
> >
> > It occurs to me that to get better power efficiency, Squeak may need to
> > learn how to go to sleep more often. At present it's using about a
> > quarter of a core on my phone when I'm not doing anything to it.
> >
> > JIT could help that, I guess; but more generally, it'd be nice just not
> > to be awake when there's nothing pressing to do...
>
> The solution is a modified event architecture and jettisoning
> relinquishProcessorForMilliseconds:.  Search the archives (squeak-dev &
> vm-dev) for “event driven vm”.  This is work that should have been done a
> long time ago (I did this for the VisualWorks vm back at the turn of the
> century or thereabouts).  But it isn’t going to get done unless someone
> steps up.  My input queue is full to overflowing.
>

Not just the VM, but we would also need to modify the image to be
event-driven.

A lot of Morphic code works by polling for changes in state (typically in a
"step" method), rather than reacting to events. That is almost elegant in
its simplicity, but rather wasteful. It was designed before power
consumption became an issue we care about. Nowadays, Morphs should only be
stepping if they are actively animating something without user input.

Basically, the UI process should sleep until there is an event, which
could be a user event, a timer event, or some asynchronous state change
(like a network package arrived, etc).

I guess Morphic can accommodate that, or it might need a larger re-design.
E.g. Tweak was designed around every UI element running in a separate
thread, and sleeping until there was actually something to do.

- Vanessa -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200901/d3cdad34/attachment.html>


More information about the Squeak-dev mailing list