• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTask troubles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask troubles


  • Subject: Re: NSTask troubles
  • From: John Stiles <email@hidden>
  • Date: Thu, 12 Jul 2007 16:29:17 -0700

On Jul 12, 2007, at 4:16 PM, Alastair Houghton wrote:

On 13 Jul 2007, at 00:04, John Stiles wrote:

Well, I think I understand what you're saying here—atos' output is queued up and not being sent back to me—but do you know how to work around the issue? Reading the docs, I only see two semi- promising approaches: do an fsync on the file descriptor, or call - synchronizeFile on the pipe's NSFileHandle.

I'll try these, but I'm still not sure why this would work fine on Intel…

It probably isn't the pipe buffer that's causing you trouble here.

If the problem is the output buffering in the C runtime (which I think you'll find it is), then neither of those will solve it. There are three fixes that will work:

1. Change your program to follow the pseudo-code I wrote. That's how we solved the same problem here.

2. Change your program to use a pseudo-tty rather than a pipe.

3. Change atos itself so that it either (a) doesn't use output buffering or (b) does an explicit fflush() after printing each result.

Plainly option 3 is not practical. Option 1 is fairly straightforward and works fine for atos; option 2 is a bit trickier, but is a more general way to let your program drive software that exhibits "interactive" behaviour.

Well, with Option 1, if I close the write site of the pipe, can I reopen it later? If not, then I'd have to close the atos session and begin a new one, which isn't really a good choice for us since each new instantiation takes a looooong time for our current app. (About 60 seconds, no joke.) This is for a graphical debugger tool and we may be showing many different stack crawls as the user navigates the UI.


For option 2, this is unfamiliar territory for me, so do you know where I could find any sort of example code? (I'll Google around as well)_______________________________________________

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


  • Follow-Ups:
    • Re: NSTask troubles
      • From: "R. Matthew Emerson" <email@hidden>
    • Re: NSTask troubles
      • From: John Stiles <email@hidden>
References: 
 >NSTask troubles (From: John Stiles <email@hidden>)
 >Re: NSTask troubles (From: Alastair Houghton <email@hidden>)
 >Re: NSTask troubles (From: John Stiles <email@hidden>)
 >Re: NSTask troubles (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: Sharing a Framework between multiple applications
  • Next by Date: Re: NSTask troubles
  • Previous by thread: Re: NSTask troubles
  • Next by thread: Re: NSTask troubles
  • Index(es):
    • Date
    • Thread