Gopal S Akshintala
08/20/2020, 2:15 PMsuspend fun findBigPrime(): BigInteger =
withContext(Dispatchers.Default) {
BigInteger.probablePrime(4096, Random())
}
bezrukov
08/20/2020, 2:51 PMbut how can the Dispatcher make use of all cores on the system?Should it? Non-blocking != parallel
Won't this just run on single background thread?yes.
Gopal S Akshintala
08/20/2020, 3:34 PMDispatchers.Default
for this case instead of a thread? Is there any difference I'm missing?bezrukov
08/20/2020, 3:42 PMsuspend fun fidBigPrime(): BigInteger = Thread { ... }.start()
Zach Klippenstein (he/him) [MOD]
08/20/2020, 3:42 PMGopal S Akshintala
08/20/2020, 5:11 PMZach Klippenstein (he/him) [MOD]
08/20/2020, 5:28 PM