Hi guys, let me ask you a simple question. When u...
# coroutines
g
Hi guys, let me ask you a simple question. When using co-routines, will we be using all cpus available always?
🚫 4
l
Maybe girls could reply too, all folks in fact. Read the documentation of
Dispatchers
and its members (Main, Default and IO), that will answer your question.
👍 5
👎 3
t
It depends on the
CoroutineDispatcher
you're using: -
Dispatchers.Default
uses a pool of threads having at most 1 thread per CPU core -
<http://Dispatchers.IO|Dispatchers.IO>
uses up to 64 threads -
Dispatchers.Main
has only one thread - When not specifying a dispatcher, it inherits the parent scope's I Hope I correctly understood the question !
g
@louiscad, about
guys
, I’ve asked my personal English teach that is from England and he said to me that
guys
is completely generic. Not referring to males. In his words
Copy code
I disagree with him. Guys is totally generic. You can even call a group of only women, "guys"
7
😱 1
🤔 1
@tseisel, interesting, I didn’t know that. I’ll be reading the Dispatchers section as @louiscad said, but have we an option that we could use as many threads as needed in all cpu cores if we want?
l
@GarouDan I think that what best suits your needs is
Dispatchers.Default
.
@GarouDan About "guys" and your teacher, did you ever saw the following sentence? "She is a nice guy" Just search on the web and in dictionaries for that 😉
💩 3
👌 1
👍 1
s
using
guys
is grammatically correct, but it’s also androcentric as hell https://en.wikipedia.org/wiki/Androcentrism#Generic_male_language
4