c++ - Concurrent system calls in Linux -


simple question is, haven't found googling. safe make concurrent calls linux system, such calling socket() on several threads @ (what might be) same time? specifically, kernel guarantee thread-safety socket(), connect(), and/or send()?

if not, why not? i'd learn more topic , why system calls or not thread-safe.

my main concern here socket() not return duplicate or invalid file descriptor when called different threads. i'm not going connecting or writing same socket @ same time in case.

is safe make concurrent calls linux system, such calling socket() on several threads @ (what might be) same time?

yes, thread safe. though not sure per posix standard or not.

specifically, kernel guarantee thread-safety socket(), connect(), and/or send()?

as per this link, yes. says locks used internally, mean send operation serialized, not in specific order.

answer updated part of question:

my main concern here socket() not return duplicate or invalid file descriptor when called different threads.

no worries here. os make sure file descriptors socket not duplicated.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -