Re: Importance of thread safety and performance.
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