Re: Main Thread UI and Detached Thread
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