DomainpcSourcewait_on_unavailable () when all cores are used and more are requested, wait for cores to be freed instead of crashing.
get_available_cores () returns the number of available cores.
isolate_current () ensures that the current domain (usually the main one) is restricted to run on a core where other isolated domains can't run.
spawn ?isolated f if isolated is true spawns a domain that runs on a given core, otherwise behaves as Domain.spawn.
isolated is true by default.
spawn_n ?isolated ?n f if isolated is true, n is provided and is less than or equal to the number of free physical cores, spawns n new domains. If n is not provided and there is at least one free physical core, spawns as many domains as there are physical cores.
If isolated is false, the spawned domains are not guaranteed to run on separate cores.
isolated is true by default.