[erlang-questions] tcp sockets - not clear

Edwin Fine <>
Mon Oct 6 22:34:07 CEST 2008



Oscar Hellström-2 wrote:
> 
> I'm assuming that a object is something running in a separate thread,
> which means that you will have to have a thread safe implementation of the
> send() function to be able to get the messages through without problems.
> AFAIK know at least the POSIX implementations are thread safe. Another
> important part here is 
Huh, I didn't think of it in that way. I was assuming that each object (i.e.
thread) would open its own socket, not share one socket amongst multiple
threads. Sharing the channel would really complicate things, as you rightly
say. You'd have to create a protocol to multiplex the data onto the channel,
and demultiplex it on the other side, handling fragmentation properly. On
the other hand, maybe it will be necessary to have a shared socket if there
are many objects (threads) and it's not practical, or too inefficient, for
each one to have its own socket. If I am misunderstanding any of this,
please correct me.
-- 
View this message in context: http://www.nabble.com/tcp-sockets---not-clear-tp19826070p19845876.html
Sent from the Erlang Questions mailing list archive at Nabble.com.




More information about the erlang-questions mailing list