Erlang虚拟机映射到哪个内核线程? [英] Erlang virtual machine map to which kernel thread?
问题描述
Erlang虚拟机作为一个操作系统进程运行。在该过程中,它运行多个线程,一个每个调度程序(以及可能的用于异步I / O的其他线程)。默认情况下,每个CPU内核都有一个调度程序线程。
Erlang进程(绿色线程)由执行负载平衡的调度程序线程执行,所以在单个操作系统进程中可能有四十个调度器线程(在四核机器上)执行的十万个Erlang进程。通常,操作系统将调度程序线程映射到物理内核,但另请参见如何,如果有的话,Erlang Processes映射到内核线程?。
In a multiple core system there are multiple scheduler to schedule the Erlang processes. one scheduler is mapped with one CPU. My doubt is: Erlang Virtual machine is also a process running on some kernel thread. then to which to CPU it got mapped? or it share all CPUs according to the availability. (OS provide the CPU time according to the availability)?
An Erlang Virtual Machine runs as a single OS process. Within that process, it runs multiple threads, one per scheduler (and possibly additional threads for asynchronous I/O etc.). By default, you get one scheduler thread per CPU core.
Erlang processes ("green threads") are executed by the scheduler threads, which do load balancing between them, so there could be a hundred thousand Erlang processes being executed by 4 scheduler threads (on a quad-core machine) within a single operating system process. Normally, the OS does the mapping of scheduler threads onto physical cores, but see also How, if at all, do Erlang Processes map to Kernel Threads?.
这篇关于Erlang虚拟机映射到哪个内核线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!