Erlang on multicore CPU

后端 未结 3 1524
感动是毒
感动是毒 2020-12-31 03:30

I am learning erlang and am quite impressed how easy it is to parallelize work. To practice a bit I dug up the good ole Fibanocci sequence. In the following code I try to ta

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 04:09

    Erlang does not use threads in the traditional sense. The Erlang VM creates one system thread for each hardware core of the CPU. When you start a thread in Erlang, you are really creating a "task", which is different from a system thread. Erlang manages these tasks inside of the VM.

    Depending on VM and it's configuration, these tasks may or may not be mapped to individual CPU cores, which I believe is what you are seeing here.

    There is an interesting blog article you might like here.

提交回复
热议问题