Ahmed Ibrahim
10/08/2020, 1:10 PM<http://Dispatchers.IO|Dispatchers.IO>.asExecutor()
, but I'm wondering if that would be an appropriate solution since as far as I learned Dispatchers.Default
shares some threads from IO and that might cause another set of problems.
So the question is, would that be a good solution to the problem from multi-threading perspective?Long monitor contention with owner DefaultDispatcher-worker-6 (27719) at android.database.sqlite.SQLiteConnection android.database.sqlite.SQLiteConnectionPool.waitForConnection(java.lang.String, int, android.os.CancellationSignal)(SQLiteConnectionPool.java:-1) waiters=0 in void android.database.sqlite.SQLiteConnectionPool.closeAvailableNonPrimaryConnectionsAndLogExceptions() for 2.511s
However not sure if I should ignore themgildor
10/08/2020, 2:56 PMAhmed Ibrahim
10/08/2020, 3:09 PMWhat kind set of problems could be caused by the fact that Default and IO share thread pool?I'm not entirely sure, but perhaps since Default executor is supposed to be limited by the number of CPU core, it might suffer from thread starvation issues, as the IO would consume from Default's pool. (I might've gotten that wrongly though)
Why do you need a special thread pool for Room, isn't it already provide coroutine api and it uses IO under the hoodIt provides suspending calls, but it uses their own dispatchers as per this link, which by default is a newFixedThreadPool
bdawg.io
10/08/2020, 5:56 PMgildor
10/09/2020, 12:34 AM