|To:||Terje Eggestad <terje.eggestad@xxxxxxxxx>|
|Subject:||Re: anyone ever done multicast AF_UNIX sockets?|
|From:||Chris Friesen <cfriesen@xxxxxxxxxxxxxxxxxx>|
|Date:||Mon, 03 Mar 2003 12:09:37 -0500|
|Cc:||linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, netdev@xxxxxxxxxxx, linux-net@xxxxxxxxxxxxxxx, davem@xxxxxxxxxx|
|User-agent:||Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204|
Terje Eggestad wrote:
On a single box you would use a shared memory segment to do this. It has the following advantages: - no syscalls at all
Unless you poll for messages on the receiving side, how do you trigger the receiver to look for a message? Shared memory doesn't have file descriptors.
- whenever the recipients need to use the info, they access the shm directly (you may need to use a semaphore to enforce consistency, or if you're really pressed on time, spin lock a shm location) There is no need for the recipients to copy the info to private data structs.
How do they know the information has changed? Suppose one process detects that the ethernet link has dropped. How does it alert other processes which need to do something?
Why does it help you to know that there are no recipients contra the
It's true that if I have a nonzero number of listeners it doesn't tell me anything since I don't know if the right one is included. However, if I send a message and there were *no* listeners but I know that there should be at least one, then I can log the anomaly, raise an alarm, or take whatever action is appropriate.
Also: Keep in mind that either you do multicast, or explisit send to
Granted, shared memory (or sysV message queues) are the fastest way to transfer data between processes. However, you still have to implement some way to alert the receiver that there is a message waiting for it.
For large packet sizes it may be sufficient to send a small unix socket message to alert it that there is a message waiting, but for small messages the cost of the copying is small compared to the cost of the context switch, and the unix multicast cuts the number of context switches in half.
-- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@xxxxxxxxxxxxxxxxxx
|<Prev in Thread]||Current Thread||[Next in Thread>|
|Previous by Date:||Re: [PATCH] Re: IPSec: setkey -DP freezes machine, David S. Miller|
|Next by Date:||Re: anyone ever done multicast AF_UNIX sockets?, David S. Miller|
|Previous by Thread:||Re: anyone ever done multicast AF_UNIX sockets?, David S. Miller|
|Next by Thread:||Re: anyone ever done multicast AF_UNIX sockets?, David S. Miller|
|Indexes:||[Date] [Thread] [Top] [All Lists]|