• 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 10:55:58 -0700

Jon, Thanks for the reply,

How many times? Locking should be absolutely negligible.
Well, maybe "a lot". I just want to be "safe" in design from the start.
I think doing a posix lock and unlock is not very performance hurting,
but maybe NSLock is - because of Obj-C messaging... double the messages
just for thread-safety doesn't sound good...

Another idea is to make two methods like -threadSafeAddObject and - addObject...
A possibly better alternative would be to have a method -[myObject addObjectsFromArray:someArray], which will only need to lock one lock, add everything, and then unlock it.
Yea, thats a good idea. I'll do that. 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


  • Follow-Ups:
    • Re: Importance of thread safety and performance.
      • From: Chris Hanson <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>)

  • Prev by Date: Re: Importance of thread safety and performance.
  • Next by Date: NSSliderCell don't change my data.
  • Previous by thread: Re: Importance of thread safety and performance.
  • Next by thread: Re: Importance of thread safety and performance.
  • Index(es):
    • Date
    • Thread