[erlang-questions] Erlang VM will open all socket in every thread?

Lukas Larsson lukas@REDACTED
Tue Dec 15 11:06:29 CET 2015


Hello,

On Tue, Dec 15, 2015 at 9:51 AM, linbo liao <llbgurs@REDACTED> wrote:

>
> If application operate a socket, will it be opened in every Erlang VM
> thread?
>
>
Reading about task in the manual page for proc(5)
http://man7.org/linux/man-pages/man5/proc.5.html

    For attributes that are shared by all threads, the con‐
    tents  for each of the files under the task/[tid] subdirectories
    will be the same as in the  corresponding  file  in  the  parent
    /proc/[pid]  directory (e.g., in a multithreaded process, all of
    the task/[tid]/cwd  files  will  have  the  same  value  as  the
    /proc/[pid]/cwd  file  in the parent directory, since all of the
    threads in a process share a working directory).

The fds is another example of a resource that is shared across tasks so all
of them will be duplicated in procfs. The reason you are seeing different
values for different tasks is most likely because your application is
opening new sockets while you are running the commands.

Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151215/d87c2b67/attachment.htm>


More information about the erlang-questions mailing list