Re: memory advice for still learning coder
Re: memory advice for still learning coder
- Subject: Re: memory advice for still learning coder
- From: Ken Thomases <email@hidden>
- Date: Sat, 3 Oct 2009 09:37:11 -0500
Oh, and I forgot to respond to this:
On Oct 3, 2009, at 9:17 AM, Rick C. wrote:
4. i don't believe i'm having a problem with the arrays being
accessed the same time by different threads. although i am not
using a lock.
If I'm understanding what you're saying, you're courting disaster. If
there's any chance at all that a mutable array is being mutated in one
thread at the same time as another thread is accessing the array, then
you must guard that with a lock. The fact that (you think) you've
never seen a problem in your testing so far is no guarantee that your
app won't have a problem under different loads, on machines with
different numbers of CPU cores, or just randomly but with somewhat low
probability. The possible problem might be obvious, like a crash, but
it might be insidious like data corruption that isn't immediately
noticed.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden