Network socket concurrency (userland)
Joerg Sonnenberger
joerg at britannica.bec.de
Tue Nov 16 15:38:33 UTC 2010
On Tue, Nov 16, 2010 at 03:37:59PM +0100, Ivan Voras wrote:
> Are there any standard-defined guarantees for TCP network sockets
> used by multiple threads to do IO on them?
System calls are atomic relative to each other. They may be partially
executed from the perspective of a remote system, e.g. due to
segmentation, but one system call will finish before the next call of
the same category is started.
> Specifically, will multiple write() or send() calls on the same
> socket execute serially (i.e. not interfere with each other) and
> blocking (until completion) even for large buffer sizes? What about
> read() / recv()?
All write operations are serialised against each other, just like all
read operations are serialised against.
Joerg
More information about the freebsd-hackers
mailing list