A system call to send the same tcp message to multiple destinations/hosts
I need to send/fan-out the same message to a list of hosts efficiently. The logic would require looping through each socket to write the message out. If this logic runs in the linux user mode, the underlying OS will call the system call as many times as the number of hosts. This is expensive since each system call requires a user-mode to kernel-mode context switch. It would be more efficient if the loop can be moved in a system call that takes a list of hosts (file descriptors). Does such system call exist in linux?
|