yet another retain/release question...
Sorry for flooding the forum with these types of questions... you guys have been über-helpful and I really appreciate it! 
on to the question...
Are the retain and release methods thread-safe? That is, do I need to lock around calls to them if there is a chance that two or more threads might try to call an object's retain or release method at the same time? How about autorelease?
Thanks,
Andrew

on to the question...
Are the retain and release methods thread-safe? That is, do I need to lock around calls to them if there is a chance that two or more threads might try to call an object's retain or release method at the same time? How about autorelease?
Thanks,
Andrew
Wow, there's a lot more explicitly stated as thread-safe than I recall. Anyone know whether my memory's faulty, or whether some of that stuff is new in recent versions of Mac OS X?
Thanks for the links Fenris 
I actually came across both of those pages a while back, but then only gave them a quick read. Now, after reading them in detail, it does seem as though Apple synchronized around the code which modifies the retain count ivar of an immutable object. It would be nice if they could give a direct answer though. Maybe I'll ask this question on the Apple's cocoa-dev list.
I found something else which might help me out (if I'm deciphering it correctly). This is from a link off the Thread Safety Guidelines page regarding Core Foundation:
I'm not exactly sure what they mean by this though. Are they talking about an explicit call to CFRetain() or an implicit call?
Keith, I seem to remember there being a shorter list of thread safe classes as well. It says the page was last updated on 2005-03-03.

I actually came across both of those pages a while back, but then only gave them a quick read. Now, after reading them in detail, it does seem as though Apple synchronized around the code which modifies the retain count ivar of an immutable object. It would be nice if they could give a direct answer though. Maybe I'll ask this question on the Apple's cocoa-dev list.
I found something else which might help me out (if I'm deciphering it correctly). This is from a link off the Thread Safety Guidelines page regarding Core Foundation:
Quote:You cannot rule out, for example, indeterminate behavior resulting from retaining an object obtained from a collection. The collection itself might be freed before the call to retain the contained object is made.
I'm not exactly sure what they mean by this though. Are they talking about an explicit call to CFRetain() or an implicit call?
Keith, I seem to remember there being a shorter list of thread safe classes as well. It says the page was last updated on 2005-03-03.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Alloc/Release question | Neocron | 5 | 3,158 |
Feb 5, 2009 04:08 PM Last Post: daveh84 |
|
| retain count weirdness | Andrew | 12 | 4,816 |
May 29, 2005 10:55 PM Last Post: Fenris |
|

).
