write function calls from multiple threads to the same socket
is it safe ? Do we wanted to add a syncronization among them? Will it cause fro problems like Application getting delayed write/read from the Network Layer to Application layer
We are using GNU C++ libraries GCC 4 on Linux Redhat Enviornment
This is a Server Side Process where There is only 1 Socket Connectivity between Server & Client Server & Client are on 2 diffent Machines Data is send from Server to Client Client to Server
Problem 1-when Server Send Data to Client Side (Multiple Threads Write data to client Side through the Same Single Socket) But Data Writen from the some of the threads are not gone to client side it doesnot even gone to the network Layer of the same machine (Tcpdump does not have that data)
Problem 2-when Client Send data to Server Data Send By Client is shown in the the server's TCPdump not received for the server application which is reading from the socket from a single thread usinga "read" & "select" functions in a loop
We were unable to identify the pattern of occuring these Problems We think This happend when so many multiple threads are writing to Same socket We are not syncronizationed write function hoping that OS is handling the syncronization
write() is a system call, not a library function, and system calls are generally guaranteed to be atomic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With