Daniele Segato
02/23/2023, 4:43 PM@JvmField
internal val CORE_POOL_SIZE = systemProp(
"kotlinx.coroutines.scheduler.core.pool.size",
AVAILABLE_PROCESSORS.coerceAtLeast(2),
minValue = CoroutineScheduler.MIN_SUPPORTED_POOL_SIZE
)
and
internal val AVAILABLE_PROCESSORS = Runtime.getRuntime().availableProcessors()
does this means that the Default dispatcher contains both big and little cores? and assign work to do to each or the other just depending on the order they gets in?
Anyone has information on how this works? Do I have any control on which profile gets chosen as a developer or am I misinterpreting the all thing and the cores are swapped under the hood by the OS transparently?
Thanks in advance to whoever can help me gain a better understanding on this topic.phldavies
02/23/2023, 5:31 PMn
threads - it’s still up to the OS to schedule the execution of threads on (and possibly move between) cores. The OS could theoretically schedule all threads on a single core (fighting for resources etc) - and it may well be that this will happen on the little
cores until a threshold is reached in which threads may be scheduled instead on the big
cores. I couldn’t tell you exactly how the OS scheduler works here but the main point is to not conflate the threadpool size being “total cores” and actual allocation of a thread to a core.louiscad
02/23/2023, 11:59 PMromainguy
02/24/2023, 12:04 AMDaniele Segato
02/24/2023, 8:59 AMDispatcher.Default
in coroutine will have a pool of 4 threads and the OS will switch between big/little outside my control.
Have I got it correctly? thank you.romainguy
02/24/2023, 4:15 PMDaniele Segato
02/24/2023, 4:18 PM