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!
The EPMD can be started explicitly or automatically as a result of the Erlang node startup. By default the EPMD listens on port 4369.
A port driver is a linked-in driver that is accessible as a port from an Erlang program. It is a shared library (SO in UNIX, DLL in Windows), with special entry points. The Erlang runtime system calls these entry points when the driver is started and when data is sent to the port.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With