Assume a tcp/ip connection between two Linux platforms established via
the socket interface. The processes on the two platforms communicate
through a file descriptor.
Is it possible to simultaneously read and write on one socket file
descriptor from 2 threads within the process, i.e. one thread reads
data the other thread writes data at the same time on the same file
descriptor ?
Or will this screw up my data ?
Thanks
Pallav Singh
>Is it possible to simultaneously read and write on one socket file
>descriptor from 2 threads within the process, i.e. one thread reads
>data the other thread writes data at the same time on the same file
>descriptor ?
It will work but (very likely) only one thread will actually be running
at any one instant in time, unless you can schedule each thread to run
on a different core of a multicore CPU (?).
--
Chris.