> On Feb 2, 2018, at 3:16 PM, [email protected] wrote:
> 
> I'm growing tired of crashes related to multiple threads accessing the 
> database at the same time and I can either go through and put everything in 
> queues (not sure yet if NSOperation or dispatch), or try switching to 2.0 
> which I expect I'd end up doing in time anyway.

2.0 will provide more thread-safety, but you can still get yourself in trouble. 
For example, modifying the same document on two threads at once will create a 
conflict, and it gets worse if you’re using the same CBLDocument object on 
multiple threads, since the value of a property will depend on which thread 
wrote to it last.

If you’re having trouble keeping track of which threads/queues your code is 
running on, that’s a “code smell” that can indicate trouble with your design. 
(Not saying this to insult you; I’ve definitely been there myself!)

—Jens

Jens Alfke — Mobile Architect — Couchbase, Inc.

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/BB6A3987-C306-4447-AC1F-3F4F95367AFA%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to