• 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: Problem with reading an NSPipe->NSFileHandle to end
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with reading an NSPipe->NSFileHandle to end


  • Subject: Re: Problem with reading an NSPipe->NSFileHandle to end
  • From: Rasmus Skaarup <email@hidden>
  • Date: Mon, 12 Apr 2010 15:46:30 +0200

> Try simplifying your app by eliminating the use of background threads.  Or, if you feel you must use background threads for long-running computation, use them only for handling the data after receiving it.  Do everything involving launching the task and initiating background reads of its output from the main thread (without that bizarre bit about launching a background thread just to have it shunt some work back to the main thread).

I thought that when I added the observers from the main init, and started the tasks by doing performSelectorOnMainThread: from the background thread, it would also start the task on the same thread as the observers - the main thread. But to my suprice, if I add specific observers from startMyTask: (instead of from the main init) everything works perfectly, even though I still initate the task launch from a background thread.

Thanks for your help Ken!

Br
Rasmus Skaarup_______________________________________________

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: Problem with reading an NSPipe->NSFileHandle to end
      • From: Ken Thomases <email@hidden>
References: 
 >Problem with reading an NSPipe->NSFileHandle to end (From: Rasmus Skaarup <email@hidden>)
 >Re: Problem with reading an NSPipe->NSFileHandle to end (From: Ken Thomases <email@hidden>)
 >Re: Problem with reading an NSPipe->NSFileHandle to end (From: Rasmus Skaarup <email@hidden>)
 >Re: Problem with reading an NSPipe->NSFileHandle to end (From: Ken Thomases <email@hidden>)

  • Prev by Date: Data managment
  • Next by Date: Re: Data managment
  • Previous by thread: Re: Problem with reading an NSPipe->NSFileHandle to end
  • Next by thread: Re: Problem with reading an NSPipe->NSFileHandle to end
  • Index(es):
    • Date
    • Thread