[self-interest] Self CPU usage and file handling

Chris Double chris.double at double.co.nz
Wed Apr 23 01:33:55 UTC 2014


On Tue, Apr 22, 2014 at 9:07 PM, Russell Allen <mail at russell-allen.com> wrote:
>
> Changing the OS X version to be the same as the solaris version *seems* to work. Note that os_file's setAsync already does the ownership handling, so we shouldn't be redoing it each time anyway (Is this a sign that there were previously problems?)
>
> But I don't yet understand why the setOwnerIfFail: is failing...

>From what I can see, Self expects i/o on files to result in a SIGIO.
It then does a 'select' and then schedules any process waiting on any
file that the 'select' indicates has i/o available. To get that SIGIO
it uses an 'fcntl' command in setOwnerIfFail. If that call fails it
just yields the process since it can't guarantee receiving a SIGIO
later to wake it up.

If that call is failing with ENOTTY but terminal i/o is still working
I think we could check for ENOTTY in the fail block and ignore it. It
would pay to investigate how i/o for the terminal i/o is handled
though. Perhaps it's being picked up via a call to select that's
triggered by something else.

-- 
http://www.bluishcoder.co.nz



More information about the Self-interest mailing list