FROM : Shawn Erickson
DATE : Tue Aug 29 18:08:21 2006
On 8/29/06, Andrew Merenbach <andrew.<email_removed>> wrote:
> Thanks to all who clarified for me. I now have a great deal more
> insight into the standard accessor idioms.
I should point out that none of the variants you listed are thread
safe (not that you implied they are).
To gain thread safety use of locks or coherency domains/contracts
would need to be used... note placing locking inside of the setter is
often too granular to be useful, it really only helps to ensure the
object itself is internally consistent but code outside of that object
often needs locking to keep itself consistent as it manipulates your
object. In other words placing locking inside of a setter can easily
result in duplication of effort (overhead) without solving the larger
coherency needs of the application.
-Shawn
DATE : Tue Aug 29 18:08:21 2006
On 8/29/06, Andrew Merenbach <andrew.<email_removed>> wrote:
> Thanks to all who clarified for me. I now have a great deal more
> insight into the standard accessor idioms.
I should point out that none of the variants you listed are thread
safe (not that you implied they are).
To gain thread safety use of locks or coherency domains/contracts
would need to be used... note placing locking inside of the setter is
often too granular to be useful, it really only helps to ensure the
object itself is internally consistent but code outside of that object
often needs locking to keep itself consistent as it manipulates your
object. In other words placing locking inside of a setter can easily
result in duplication of effort (overhead) without solving the larger
coherency needs of the application.
-Shawn
| Related mails | Author | Date |
|---|---|---|
| Andrew Merenbach | Aug 29, 16:53 | |
| Shawn Erickson | Aug 29, 17:15 | |
| Ricky Sharp | Aug 29, 17:18 | |
| Alberto Ricart | Aug 29, 17:51 | |
| Andrew Merenbach | Aug 29, 17:57 | |
| Shawn Erickson | Aug 29, 18:08 | |
| Sean Murphy | Aug 29, 18:10 |






Cocoa mail archive

