[self-interest] Self CPU usage and file handling
Russell Allen
mail at russell-allen.com
Wed Apr 23 03:21:43 UTC 2014
On 23 Apr 2014, at 12:18 am, Chris Double <chris.double at double.co.nz> wrote:
> While low it would be good to remove this if possible. Can the
> interactive scanner read loop be exited when it's no longer used? I
> assume the SIGALRM usage is used for the Self scheduler. Perhaps that
> could be optimized such that it's turned off if all processes are
> blocked in i/o.
>
I think SIGALRM is also used to step morphic's polling of io. ( through worldMorph runLoop -> worldMorph delayIfNoInputFor: ms )
The runLoop method comment says:
Don't hog the CPU by running too fast when there is
no user input, even though there may be ongoing animation or
monitoring activities. If we get done before consuming the
desired frame time, sleep for the remainder of the time, checking
for user inputs at periodic intervals. (A refinement would be
to hang on the XEvent queue when there is no animation or
other activity happening, but the current scheme uses extremely
little CPU time when nothing is happening anyway.)
This is probably also the main caller of gettimeofday, which it uses to determine the time for each morphic cycle.
We can in the longer term do what the comment suggests and not poll for io, but this won't entirely fix our issue because as soon as we have an animation we will be back with SIGALRMs every few milliseconds to drive the animation.
I'll look to see whether I can find a way to turn off the interactive scanner read loop.
Russell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.selflanguage.org/pipermail/self-interest/attachments/20140423/f91268a1/attachment.html>
More information about the Self-interest
mailing list