McLaughlin, Michael P wrote:

    aTask = [NSTask new];
...
   myID = [NSString stringWithFormat:@"%d ", ident];
   inPipe = [NSPipe pipe];     // i.e., input for subtask
  outPipe = [NSPipe pipe];


If you aren't concurrently reading the output pipe from the child process, then you can end up deadlocked. The buffer in each pipe is only 16 KB (as measured empirically, not a guaranteed size).

Suppose the child process writes output to its end of the output pipe. When the pipe buffer fills up because no one is reading the other end, the child blocks. This will then stall any process that's writing data to the child's input pipe, as soon as the input-pipe buffer fills up.

The total amount of data it takes to cause deadlock depends on the amount of input data, the amount of stream buffering done by the child process (e.g. stdio FILE* buffers), and the amount of output data generated.

Find where the child process is blocked.  Or show more code.

  -- GG

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to