高效的 Erlang 端口驱动程序
我想生成 Erlang 进程,通过端口驱动程序与 C 程序进行通信。
由于生成许多这样的进程可能效率低下,我可以生成一个接收消息并将这些消息排队以便用 C 程序处理的 Erlang 进程吗?
当这个 C 程序开始等待传入的作业时,它会阻塞吗?
最好的策略/架构是什么?
谢谢!
I want to spawn Erlang processes that will communicate with a C program through a Port Driver.
As spawning many of these processes can be inefficient, can I spawn one Erlang process that receives messages and queue these messages for processing with the C Program?
As this C program starts to wait for incoming jobs, will it block?
What's the best strategy/architecture?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,通常您有一个进程连接到流量所经过的端口。有关端口的合理描述以及如何使用它们,请阅读 Erlang 互操作性教程用户的指南。它解释了不同类型的端口及其属性。
一般来说,http://www.erlang.org 上的文档非常好,非常值得阅读。
Yes, generally you have one process which is connected to the port which traffic goes through. For a reasonable description of ports and how to use them read the Erlang Interoperability Tutorial User's Guide. It explains the different types of ports and their properties.
Generally speaking the documentation at http://www.erlang.org is quite good and well worth reading.