Re: Properties and memory management with overrides.

2009-01-26 Thread Ben Trumbull
On Jan 26, 2009, at 2:45 PM, Sean McBride wrote: On 1/18/09 4:29 PM, Ben Trumbull said: I mention this because (I'm embarrassed to admit) I never really thought about this till yesterday. I *think* other design decisions have made the atomic-ness irrelevant to any of the code I've written,

Re: Properties and memory management with overrides.

2009-01-26 Thread Quincey Morris
On Jan 26, 2009, at 16:26, Bill Bumgarner wrote: However, even if only one thread can be changing the data, atomicity still matters. If the accessors aren't atomic, multiple read-only users of the data (in different threads) might get completely bogus results. This problem *can* be solved b

Re: Properties and memory management with overrides.

2009-01-26 Thread Bill Bumgarner
On Jan 26, 2009, at 4:00 PM, Quincey Morris wrote: Although the rationale for non-atomicity runs under the general thread-safety discussion umbrella, there are actually two separate issues to consider. It helps to explicitly *not* think about atomicity under the same umbrella as thread saf

Re: Properties and memory management with overrides.

2009-01-26 Thread Quincey Morris
On Jan 26, 2009, at 14:45, Sean McBride wrote: On 1/18/09 4:29 PM, Ben Trumbull said: I mention this because (I'm embarrassed to admit) I never really thought about this till yesterday. I *think* other design decisions have made the atomic-ness irrelevant to any of the code I've written, bu

Re: Properties and memory management with overrides.

2009-01-26 Thread Sean McBride
On 1/18/09 4:29 PM, Ben Trumbull said: >> I mention this because (I'm embarrassed to admit) I never really >> thought about this till yesterday. I *think* other design decisions >> have made the atomic-ness irrelevant to any of the code I've written, >> but now I need to go back and check, especia

Re: Properties and memory management with overrides.

2009-01-18 Thread Ben Trumbull
And (I assume, for the same reason) that since the property is by default atomic, the override is also responsible for implementing any actual atomic behavior. That's true. Custom accessor methods should respect the property attributes or the property attributes should reflect the behavior of

Re: Properties and memory management with overrides.

2009-01-18 Thread Quincey Morris
On Jan 18, 2009, at 13:52, Mike Abdullah wrote: You're overriding the method, so it is up to you to implement the copying behaviour. On 18 Jan 2009, at 21:19, Sandro Noel wrote: Greetings. This is probably a stupid question. if i have a property declared as @property (readwrite, copy) NSS

Re: Properties and memory management with overrides.

2009-01-18 Thread Mike Abdullah
You're overriding the method, so it is up to you to implement the copying behaviour. On 18 Jan 2009, at 21:19, Sandro Noel wrote: Greetings. This is probably a stupid question. if i have a property declared as @property (readwrite, copy) NSString *name; if I override the -(void) setName(NS

Properties and memory management with overrides.

2009-01-18 Thread Sandro Noel
Greetings. This is probably a stupid question. if i have a property declared as @property (readwrite, copy) NSString *name; if I override the -(void) setName(NSString*)value{} The object that I get as value is it already a copy? Will the object still copy if I just instanceVariable = value;