CoreData Threading docs/advice?
CoreData Threading docs/advice?
- Subject: CoreData Threading docs/advice?
- From: Jim Correia <email@hidden>
- Date: Wed, 9 Nov 2005 16:55:41 -0500
As Bill B. has said in the past, the best threading advice is to
avoid using threads. I agree. That said, suppose I do need to do work
in a secondary thread...
Is there a place which summarizes the rules for using CoreData from
multiple threads?
Over time, the advice has been:
One managed object context per thread.
Don't pass objects, just object IDs between threads.
Are there other considerations?
If you have to use a MOC on multiple threads, there are the lock
methods.
The persistent store coordinator documentation says "If you want to
use multiple threads for different write operations you use multiple
coordinators. Note that if multiple threads work directly with a
coordinator, they need to lock and unlock it explicitly."
I rarely use a persistent store coordinator directly, but indirectly
through multiple managed object contexts (at this time, all on the
main thread.) If I am only going through the MOCs, do I have to do
any locking and unlocking of the persistent store coordinator?
Thanks,
Jim
_______________________________________________
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