• 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: Do I need private accessor methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Do I need private accessor methods? (From: "Eric Lin" <email@hidden>)
 >Re: Do I need private accessor methods? (From: Ryan Britton <email@hidden>)
 >Re: Do I need private accessor methods? (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: changing NSComboBox number of visible items
  • Next by Date: Re: Do I need private accessor methods?
  • Previous by thread: Re: Do I need private accessor methods?
  • Next by thread: Re: Do I need private accessor methods?
  • Index(es):
    • Date
    • Thread