https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

aaverin

08/10/2017, 2:46 PM
Hello guys. Got a following situation: AWS m3.large instance = 2CPUs, meaning 1 thread in CommonPool Have a bunch of services that look like:
Copy code
fun getData() = async(CommonPool) {
  //do some network
  async(CommonPool) { //do some more parallel network }
  .await() //and process results all together
}
Let’s say 3-5 of such written services are called at the same time in parallel by users. Could this lead to any problems?
k

kingsley

08/10/2017, 2:50 PM
Perhaps you could create your own thread pool context.
CommonPool
isn’t particularly suited for long blocking IO operations. Also, since it is (single?) and blocking, it’s clear why time outs will happen more often
2 Views