Re: Thread safety of Cocoa Bindings
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