Secondary thread causes startup delay

Posted by JK on Stack Overflow See other posts from Stack Overflow or by JK
Published on 2010-04-17T11:02:09Z Indexed on 2010/04/17 11:03 UTC
Read the original article Hit count: 234

Filed under:
|

In my didFinishLaunchingWithOptions method I spawn a thread to perform some maintenance on my core data store. However, this increases the startup time by half a second. The startup view is a tableview which draws its content from the same store. If I let the thread sleep for a second, the startup time improves drastically.

I would like to understand why the second thread is blocking/delaying the main thread. Is it because both are trying to access the store (The second thread has its own store coordinator and context) or another reason (e.g. dont spawn threads in didFinishLaunching)?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa-touch