• 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: Thread safety of Cocoa Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread safety of Cocoa Bindings


  • Subject: Re: Thread safety of Cocoa Bindings
  • From: Bill Bumgarner <email@hidden>
  • Date: Tue, 6 Dec 2005 08:52:55 -0800

On Dec 6, 2005, at 1:47 AM, Nicolas Berloquin wrote:

The advice given to me was: use performInMainThread, and that works pretty well for me, and it's easy to use.

That would be the safe way to go.
hello !
One question : how big is performInMainThread's overhead ?
Let's say there are a few dozen updates per second, for example ?

I would suggest rephrasing the question: How much overhead is incurred by applying dozens of non-contiguous updates per second to the UI?

Regardless of threading, the answer is going to be "unacceptably large". In particular, all that interrupting of the main event loop for applying [hopefully small] updates is going to interrupt event processing and make your app's responsiveness choppy.

I would suggest coalescing the updates coming out of the background thread such that there are around 1 update per second. And don't send an update request until the previous update request has been fully processed.

Given the vast array of potential machines upon which your application may run, you should really give some thought to implementing an adaptive algorithm that ensures the updates are coalesced in a fashion that maximizes responsiveness.

b.bum



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Re: Thread safety of Cocoa Bindings (From: Theo Vosse <email@hidden>)
 >Re: Thread safety of Cocoa Bindings (From: j o a r <email@hidden>)
 >Re: Thread safety of Cocoa Bindings (From: Nicolas Berloquin <email@hidden>)

  • Prev by Date: Re: Double-clicking multiple selection in a TableView
  • Next by Date: Re: How to find a window under the cursor
  • Previous by thread: Re: Thread safety of Cocoa Bindings
  • Next by thread: Re: Thread safety of Cocoa Bindings
  • Index(es):
    • Date
    • Thread