I notice a very strong correlation between UI freezing and my replication 
logging statements, which seem to be getting dispatched on the main thread. 
The CBL instance is tied to a background thread, so I am not sure what else 
it could be. 

Is the replication running on the same thread that the CBL manager instance 
is tied to? If that's the case, then perhaps the replication activity is 
simply blocking reads to the database, which are blocking UI actions? 
Normally I'd assume reads of a single doc by ID to be imperceptibly fast, 
but there are noticeable UI lags whenever replication seems to be 
occurring. 

On Thursday, November 13, 2014 3:29:34 PM UTC-5, Jens Alfke wrote:
>
>
> On Nov 13, 2014, at 9:22 AM, Chris Fuentes <[email protected] 
> <javascript:>> wrote:
>
> What I am primarily interested in doing is separating the replication 
> thread from the threads that will be performing reads/writes, since the 
> replication thread becomes very busy from time to time and effectively 
> freezes interaction with the db. 
>
>
> Replication *always* runs on a background thread. The CBLReplication 
> object is just a facade that configures the real replication task and 
> reports what it's doing. So it doesn't really matter what thread you start 
> a replication on; it's often best to do it on the UI thread so you can 
> easily use the notifications to drive progress indicators.
>
> —Jens
>

-- 
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/fc6b00a8-6db5-476e-b789-3b6d3db4dbc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to