Re: process monitoring panic
Re: process monitoring panic
- Subject: Re: process monitoring panic
- From: Ken Thomases <email@hidden>
- Date: Wed, 3 Sep 2008 00:45:43 -0500
On Sep 3, 2008, at 12:03 AM, Paul Archibald wrote:
Okay, this has me stumped. Does Xcode somehow pipe the output of
the CLP to my app when it is present, and when its not there that
pipe is never "hooked up"?
It is your responsibility to establish the pipe between the
subprocess and your application. You need to be doing that explicitly.
This CLP is a major hog, it grabs 85+% of the CPU when it runs,
does that make a difference? I thought my app would work better if
Xcode was not using half the available memory itself.
Shouldn't matter.
Anyone have any ideas what to look at here? I am using an NSTask
wrapper class (TaskWrapper) I adapted from the Moriarity sample to
do the sublaunch and monitoring stuff. ( I have a fix for it under
Leopard which I will report on later, just to try to put something
back into the pot.)
It sounds like your subprocess is buffering its output. See the
setvbuf man page. Until the subprocess writes enough to fill its
buffer, it won't put anything on the pipe. When the process shuts
down, it flushes all of its buffers.
Xcode may have convinced the subprocess that its output is to a tty,
which is line buffered rather than block buffered. I'm not sure why
that would happen since you are (or should be) controlling the nature
of the subprocess's output.
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden