• 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: Need -[NSTask waitUntilExitOrTimeout:] (was NSTask "Thread Unsafe"...)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need -[NSTask waitUntilExitOrTimeout:] (was NSTask "Thread Unsafe"...)


  • Subject: Re: Need -[NSTask waitUntilExitOrTimeout:] (was NSTask "Thread Unsafe"...)
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 14 Sep 2009 20:51:31 -0700


On Sep 14, 2009, at 6:29 PM, Jerry Krinock wrote:

Uh, yeah, it took me a while to track that one down. Apparently, running a run loop that is already running is not a good idea.

That's not generally true; there's definitely code that does this. I've found that generally it helps to run the runloop in some nonstandard mode, otherwise you can end up with weird re-entrancy problems where some kind of event gets delivered during your loop and triggers other handlers in your app. This might explain the NSUndo problem you had.


I've got an NSTask wrapper in my MYUtilities library, which is being used pretty heavily in my app Murky.

(I've definitely found NSTask to be difficult to use. It seems straightforward enough, but if you want to use it in a nonblocking way, and handle I/O redirection, it gets surprisingly tricky. It really shouldn't take 400+ lines of code to implement MYTask, but somehow it does...)

—Jens_______________________________________________

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


References: 
 >NSTask is "Thread Unsafe". What does that mean? (From: Jerry Krinock <email@hidden>)
 >Re: NSTask is "Thread Unsafe". What does that mean? (From: "Adam R. Maxwell" <email@hidden>)
 >Need -[NSTask waitUntilExitOrTimeout:] (was NSTask "Thread Unsafe"...) (From: Jerry Krinock <email@hidden>)

  • Prev by Date: How to implement to rename the file by single click its name column
  • Next by Date: Re: How to implement to rename the file by single click its name column
  • Previous by thread: Need -[NSTask waitUntilExitOrTimeout:] (was NSTask "Thread Unsafe"...)
  • Next by thread: Re: Need -[NSTask waitUntilExitOrTimeout:] (was NSTask "Thread Unsafe"...)
  • Index(es):
    • Date
    • Thread