• 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: Importance of thread safety and performance.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Importance of thread safety and performance.


  • Subject: Re: Importance of thread safety and performance.
  • From: Andre <email@hidden>
  • Date: Sat, 9 Jul 2005 11:15:30 -0700

Hi Pandaa,

The only way to find out if it will be a performance problem is to write the code and profile it, do not let fear stall your development! :)
But more importantly, having each and every accessor handle locking may lead to larger code size and the need to carefully avoid deadlocks when locking methods call each other or methods which acquire several locks are called from several threads.
Yea, thats another thing to worry about. Thats gonna cost more time upfront I would think...

Unless your class is continually accessed from or coordinates work for many different threads, it will probably be easier to handle the locking from the outside of the class in objects that logically take on a coordinating role. This will keep the interactions between different locks simple, and when performing a series of primitive operations it will be easy to handle intermediate object states that should not be exposed to other threads.
Thats another possibility. I had thought about that but forgot, its a good idea, thanks.

I would rather do things "the right way" first than waste my time later in upkeep...
That's a good attitude! :) But often there is no "right way" and even if there is one it may not be easy at all to discover it at the onset. Wasting time in upkeep may sometimes be the most efficient way of discovering the right solution.
Yea, thats right too... well, at least I've got some good tips along the way!

Thanks.

Andre
_______________________________________________
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: 
 >Importance of thread safety and performance. (From: アンドレ(Andre) <email@hidden>)
 >Re: Importance of thread safety and performance. (From: Jonathon Mah <email@hidden>)
 >Re: Importance of thread safety and performance. (From: Pandaa <email@hidden>)

  • Prev by Date: NSSliderCell don't change my data.
  • Next by Date: Re: Determining if NSArray/NSDictionary is immutable
  • Previous by thread: Re: Importance of thread safety and performance.
  • Next by thread: Re: Importance of thread safety and performance.
  • Index(es):
    • Date
    • Thread