<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 23 Apr 2014, at 10:47 am, jas <<a href="mailto:jas@cruzio.com">jas@cruzio.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); position: static; z-index: auto;"><div id="ygrp-mlmsg" style="font-size: 13px; font-family: Arial, helvetica, clean, sans-serif; position: relative;"><div id="ygrp-msg" style="line-height: 1.22em; z-index: 1;"><div id="ygrp-text" style="line-height: 1.22em; font-family: Georgia;"><p style="line-height: 1.22em; margin: 0px 0px 1em;">Just guessing, here, as I don't have anything to look at<br style="line-height: 1.22em;">other than this post - but the symptoms you describe fit the pattern.<br></p></div></div></div></div></blockquote>Snip</div><div><br><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); position: relative; z-index: 0;"><div id="ygrp-mlmsg" style="font-size: 13px; font-family: Arial, helvetica, clean, sans-serif; position: relative;"><div id="ygrp-msg" style="line-height: 1.22em; z-index: 1;"><div id="ygrp-text" style="line-height: 1.22em; font-family: Georgia;"><p style="line-height: 1.22em; margin: 0px 0px 1em;">Probably didn't solve the problem, but, having already reasoned<br style="line-height: 1.22em;">that it *could* have solved the problem, and noticing that it *appears*<br style="line-height: 1.22em;">not to make things worse, that 'fix' stayed in.<br></p></div></div></div></div></blockquote><div><br></div><div>This process is instantly recognisable to me as something I'm trying to train myself out of, though I can't take the blame this time :)</div><div><br></div><div>Taking that bit out of suspendIfAsync does, as you suggest, fix the immediate CPU pegging issue.</div><div><br></div><div>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 and then do the obvious:</div><div><br></div><div>[ pipe suspendIfAsyc. pipe dataReady ifTrue: [ doSomethingWith: pipe read ] ] loop</div><div><br></div><div>(or rather, I can but suspendIfAsync fails to suspend because setOwnerIfFail: fails)</div><div><br></div><div>Changing to pipe suspendIO in these circumstances instead (ie dropping setOwnerIfFail:) has the interesting side effect that the thread suspends *until some input on the command line causes SIGIO to be sent* - so that the pipe only reads while you hold down the enter key on Stdin :)</div><div><br></div><div>Reading up on how setAsync/SIGIO work reveals that, of course, BSD, Linux and Solaris all do it slightly differently. Sigh.</div><div><br></div><div>I've just checked and setOwnerIfFail/fcntl is working on Linux, which is why the CPU pegging isn't noticed.</div><div><br></div><div>Russell</div><div><br></div><div><br></div><div><br></div><div><br></div></div></body></html>