Re: NSTask interaction
Re: NSTask interaction
- Subject: Re: NSTask interaction
- From: Finlay Dobbie <email@hidden>
- Date: Tue, 20 Nov 2001 22:18:53 +0000
On Tuesday, November 20, 2001, at 10:13 pm, Andreas Monitzer wrote:
In fact, I think a better way of doing what they were doing was to use
-[NSFileHandle readInBackgroundAndNotify],
readInBackgroundAndNotify doesn't work with disk-based files, I tested
that some time ago. That's why "tail -f" uses polling instead of
select().
Since when are we talking about disk-based files? This was about pipes
and IPC. Please don't change the subject.
select() is broken for disk-based files, yes, I know that. Hmm...
Perhaps I should investigate why this is happening and go completely
insane trying to fix it :-)
but hey, I digress. I pointed this out to the article writer, but he
seemed adamant that there wouldn't be any problems with not doing
threads properly. He was under the impresison that the AppKit was
thread safe, or something.
Hey, I've changed my mind, ok? :-) My test app ran fine here, but I
didn't really stress-test it.
Well, in that case, I told ya so! :-D
I have since learned otherwise... Anyway, they should probably fix
this.
Yes, me too. I'll try to fix that article (don't forget that I'm doing
it in my spare time, there's no schedule).
However, that article is about using NSTask, not doing thread-safe
AppKit! That's something the Omni folks should know more about.
Hmm yes, but putting out code like that into the public domain is
probably not a wise idea. I wouldn't be surprised if several newbies are
adapting that code as we speak, and wondering why it's not working
properly :-)
-- Finlay