synchronizing socket reads/writes in a multi-client server application

Status
Not open for further replies.

Build-A-Burger

Full Member level 1
Joined
Oct 27, 2010
Messages
95
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Wyoming
Activity points
2,101
I'm developing a sockets client/server application (embedded linux using pthreads) where the server has threads already created for each client on the network. My question is: can I have a separate thread for each client's socket read and write that run independently (the socket can be read from and written to simultaneously). I guess I need to use either semaphores or mutexes. I don't think I need to worry about each client connection on the server, but just the read/write of each socket connection. To put my question another way: will the read thread on one socket block the write thread on the same socket?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…