本文介绍了“绿线”之间有什么区别?和Erlang的流程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在阅读关于Erlang的轻量级过程之后,我确信他们是绿色线程。在我读到之前,绿线和Erlang的进程有区别。但是我没有得到它。有什么实际差异?
解决方案>
Green Threads可以直接共享数据存储器(尽管当然需要同步)。
Erlang不使用绿色线程,而是更接近绿色进程:进程不直接共享数据内存,而是通过复制即具有源数据的独立副本)。
After reading about Erlang's lighweight processes I was pretty much sure that they were "green threads". Until I read that there are differences between green threads and Erlang's processes. But I don't get it.
What are the actual differences?
解决方案
Green Threads can share data memory amongst themselves directly (although synchronization is required of course).
Erlang doesn't use "Green Threads" but rather something closer to "Green Processes": processes do not share data memory directly but do so by "copying" it (i.e. having independent copies of the source data).
这篇关于“绿线”之间有什么区别?和Erlang的流程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
08-24 07:18