Tim Reddy
Tim Reddy

Reputation: 4438

How to implement Thread Confinement to Support Concurrency?

I'm reading the Core Data Programming Guide and under the "Use Thread Confinement to Support Concurrency" section it mentions a recommended pattern:

Create a separate managed object context for each thread and share a single persistent store coordinator.

Can somebody point me to an example implementation of such a pattern?

I am particularly interested in implementations that handle blocks. We frequently put things in a block and add it to a queue...and sometimes those objects contain references to the main thread's MOC.

Upvotes: 1

Views: 942

Answers (1)

Goca
Goca

Reputation: 1893

I know this is a old question but I found a really good tutorial for this aproach:
http://floriankugler.com/blog/2013/4/2/the-concurrent-core-data-stack
http://www.cimgf.com/2011/05/04/core-data-and-threads-without-the-headache/

I hope this help some one with the same question. :).

Upvotes: 2

Related Questions