views:

82

answers:

1

Hi,

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!

+3  A: 

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.

rvirding