Concurrency: Processes vs Threads

后端 未结 4 685
悲哀的现实
悲哀的现实 2021-02-18 23:46

What are the main advantages of using a model for concurrency based on processes over one based on threads and in what contexts is the latter appropriate?

4条回答
  •  面向向阳花
    2021-02-19 00:13

    In this case Processes are more independent of eachother, while Threads shares some resources e.g. memory. But in a general case Threads are more light-weight than Processes.

    Erlang Processes is not the same thing as OS Processes. Erlang Processes are very light-weight and Erlang can have many Erlang Processes within the same OS Thread. See Technically why is processes in Erlang more efficient than OS threads?

提交回复
热议问题