• 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: Felix Schwarz <email@hidden>
  • Date: Tue, 6 Dec 2005 21:25:18 +0100

I just wanted to know the same myself, so I did a small benchmark, that just invokes a method that does nothing (and do that a thousand times).

This is the result:

Measuring 1000 x 'performSelectorOnMainThread:' ..
Required time 0.07031 for 1000 loops, average: 0.00007

This is on a dual G5 1.8 GHz. But, unless you have dozens and dozens updates to do, this really seems neglectable.

Thanks to some private email exchange with Olivier Gillet I also had to learn that NSObjectController seems to behave in a thread-unsafe manner. The more I'm surprised that NSArrayController did behave thread-safe in my tests.

Felix


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 ?

thanks !

--
Felix Schwarz
email@hidden

Postal address:
IOSPIRIT GmbH, Berckhauser Straße 11, 90409 Nürnberg, Germany

Phone: +49 (0)911 / 3677 423
Fax: +49 (0)911 / 3677 424
Homepage: http://www.iospirit.com/

Trade register number and place of registration:
HRB 21960, Amtsgericht Nürnberg


_______________________________________________
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
  • Follow-Ups:
    • Re: Thread safety of Cocoa Bindings
      • From: John Stiles <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: NSTableView drag and drop Border
  • Next by Date: Drag & Drop Launch
  • Previous by thread: Re: Thread safety of Cocoa Bindings
  • Next by thread: Re: Thread safety of Cocoa Bindings
  • Index(es):
    • Date
    • Thread