• 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: Main Thread UI and Detached Thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Main Thread UI and Detached Thread


  • Subject: Re: Main Thread UI and Detached Thread
  • From: j o a r <email@hidden>
  • Date: Mon, 31 Mar 2008 09:36:29 -0700


On Mar 30, 2008, at 11:55 AM, Mike wrote:
In my worker thread I do a tight processing loop and one of the things I do in the loop is call two methods in the main thread to update the display (a text message and progress bar) - via performSelectorOnMainThread:withObject:waitUntilDone:modes.

However, when the loop runs in the spawned thread, the display doesn't get updated. If I insert a sleep(1) call into the loop, then the display updates.


How much work do you perform on the main thread? If a lot, it's not unexpected that you would se interruptions in display updates. You might need to throttle or otherwise limit your callouts to the main thread if this proves to be the problem.

You can use Instruments or Shark to get a view of the work being performed on the main thread while you run your worker thread.

j o a r


_______________________________________________

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: Main Thread UI and Detached Thread
      • From: Mike <email@hidden>
References: 
 >Main Thread UI and Detached Thread (From: Mike <email@hidden>)

  • Prev by Date: Main Thread UI and Detached Thread
  • Next by Date: core data and sqlite db store problem
  • Previous by thread: Main Thread UI and Detached Thread
  • Next by thread: Re: Main Thread UI and Detached Thread
  • Index(es):
    • Date
    • Thread