Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以在具有四个或更多内核的单核 erlang 程序的计算机上进行测试吗?
在不使用任何参数的情况下启动时,erlang smp 假定为 2:2,如下所示:
Erlang R14A (erts-5.8) [smp: 2:2] [rq: 2] [async-threads: 0]
我使用的是 Pentium 4,这是否意味着我有两个内核?
默认情况下,每个可用内核启动一个调度程序,并使用多个运行队列(每个调度程序一个;从 R13 开始可用)。在您的 shell[smp 2:2]中意味着您有两个调度程序在两个内核上运行;[rq: 2]表示您正在使用两个运行队列。
[smp 2:2]
[rq: 2]
如果要更改调度程序的数量,erl +S 4例如从四个调度程序开始。
erl +S 4
确保如果您在单核系统上编译 erlang,请使用 .config 在配置脚本中启用 smp --enable-smp-support。否则,您可能无法使用多个调度程序。
--enable-smp-support