[self-interest] Self CPU usage and file handling

Russell Allen mail at russell-allen.com
Thu Apr 24 05:11:35 UTC 2014


On 23 Apr 2014, at 1:02 pm, Russell Allen <mail at russell-allen.com> wrote:

> But I'm not happy yet, because I still can't do proper non-pegging IO on OS X - I can't call setOwnerIfFail: on pipes

It seems as if not being able to successfully call fcntl(pipe, F_SETOWN, pid) on OS X is not Self's fault but an OS X thing.

Easiest illustration of this is probably in python:

import os, sys, fcntl
fcntl.fcntl(sys.stdin, fcntl.F_SETOWN, os.getpid())

gives:

IOError: [Errno 25] Inappropriate ioctl for device

same as for Self.  Doing the same on a named pipe gives a 102 error : Operation not supported on socket. Which is interesting given a named pipe isn't a socket.

I can't find this documented anywhere - nothing in man page for fcntl or Apple bug reports db. I have asked on StackOverflow but no one has answered, though someone did give me a 'student' badge, so that's nice.


I am at a little bit of a loss here. We need something better than reading in a loop, or doing select with immediate timeout in a loop.

Russell


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.selflanguage.org/pipermail/self-interest/attachments/20140424/31ade2f9/attachment.html>


More information about the Self-interest mailing list