https://github.com/mmower/testcoredataconcurrency
Tests new CoreData concurrency approach.
https://github.com/mmower/testcoredataconcurrency
Last synced: about 2 months ago
JSON representation
Tests new CoreData concurrency approach.
- Host: GitHub
- URL: https://github.com/mmower/testcoredataconcurrency
- Owner: mmower
- Created: 2011-11-28T11:54:53.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-12-04T16:38:16.000Z (over 13 years ago)
- Last Synced: 2025-02-07T14:45:40.366Z (3 months ago)
- Language: Objective-C
- Homepage:
- Size: 145 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
The idea was to write something to test the new GCD based concurrency options in
CoreData for 10.7. In particular to test that it's safe to create & query from
queues and the main thread at the same time.We create a main managed object context using NSMainQueueConcurrencyType then
schedule a crap load of blocks onto a concurrent queue. We also start a timer
that will give the main thread periodic opportunties to mess things up.The blocks are of two types:
1) Add new objects using a child MOC and saves the child MOC
2) Count objects using a child MOCThe timer callback
1) Counts objects
2) Adds a new object via the main MOC and saves the main MOCThe idea is to tease out interference issues.
We have already discovered that using NSPrivateQueueConcurrencyType for the main
MOC is problematic if anything is done from the main thread. It seems that this
somehow stops the queue as no more blocks are processed. Switching to using
NSMainQueueConcurrencyType solved this problem. That's perhaps its purpose in
life.