Erlang虚拟机映射到哪个内核线程? [英] Erlang virtual machine map to which kernel thread?

查看:140
本文介绍了Erlang虚拟机映射到哪个内核线程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在多核系统中有多个调度程序可以安排Erlang进程。一个调度程序与一个CPU映射。我的疑问是:Erlang虚拟机也是一个在一些内核线程上运行的进程。那么CPU被映射到哪个?或者根据可用性共享所有CPU。 (OS根据可用性提供CPU时间)?

解决方案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆