Re: Do I need private accessor methods?
Re: Do I need private accessor methods?
- Subject: Re: Do I need private accessor methods?
- From: Ryan Britton <email@hidden>
- Date: Fri, 28 Apr 2006 19:23:18 -0700
True. I should've been more specific. Synchronized accessors alone
are definitely not enough, but they help a lot when achieving thread
safety. One less thing to worry about and all that.
On Apr 28, 2006, at 6:29 PM, Shawn Erickson wrote:
On 4/28/06, Ryan Britton <email@hidden> wrote:
They are very useful for ensuring your code is threadsafe. For this
reason alone I recommend using them.
Often the locking you would implement via accessors (inside of) is too
granular, as a result it could add overhead while not really gaining
you thread safety. In other words you often have to do more they just
use synchronize in your accessor to ensure thread safety... just make
sure you are doing it for the right reasons and in the right way (tm).
-Shawn
_______________________________________________
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