can "gen_tcp:recv" blocks my entire server?

zabrane Mikael <>
Thu Apr 22 01:12:14 CEST 2010

Hi List,

I'm impleting a simple Web server using gen_tcp:listen(Port, [...,{active,
false}]) options.
For each request, a child process is spawned to handle it.
Then, each child process use gen_tcp:recv/2 to read data from the client
Very basic design!

My question is simple. If one of my child processes calls gen_tcp:recv/2 and
blocks (due to a slow client),
does this also blocks all other spawned childs?

If yes, what's the best way to read from a socket without blocking the
entire server (i.e the other spawned processes)?


More information about the erlang-questions mailing list