Reputation: 3
Are Unix multicast sockets thread safe?
Upvotes: 0
Views: 592
Reputation: 42588
Depends on what you mean by thread-safe. It appears that making to calls to send() at the same time from separate threads will not crash your program, and all the data will be send across the network.
The problem is that if your message stretches across more than one packet. The packets may interleave and it will be up to the remote machine to sort out the two interleaved messages.
See: Be careful with the sendmsg() family of functions which I got from Are parallel calls to send/recv on the same socket valid?.
Upvotes: 3