[Spread-users] Spread implementation and C API

John Schultz jschultz at spreadconcepts.com
Fri Oct 16 13:43:53 EDT 2009

1. A Spread client's mailbox is actually a TCP or unix domain socket  
connected to a Spread daemon.  As such, it will block just like those  
kinds of sockets block.  You can use select/poll on them to watch for  
activity.  Unfortunately, they don't support 100% non-blocking  
behavior.  That is, once you start a SP_receive or a SP_multicast, if  
it needs to block, then it will and there is currently no way to tell  
it not to do so (e.g. - EAGAIN, EWOULDBLOCK, etc.).

2. Spread uses UDP for all of its inter-daemon communication.  For  
machines configured within the same Spread segment, Spread will use  
either UDP multicast or broadcast, depending on the address type you  
specify for the Spread segment.  Between segments, a sending daemon  
will send a point-to-point UDP message to the (dynamically chosen)  
leader of each of the other segments,  who will then multicast it  
within their segments.

A message sent through SP_multicast is sent to all the daemons.  So,  
typically, the client's daemon will multicast it within its local  
segment, send it point-to-point to the leaders of each of the other  
segments, who will then multicast it within their segments.  The  
daemons will then forward the message to those clients that are in the  
targeted groups current membership, either through TCP/IP or a unix  
domain socket.


John Lane Schultz
Spread Concepts LLC
Phn: 301 830 8100
Cell: 443 838 2200

On Oct 16, 2009, at 12:46 PM, Shashank Yaduvanshi wrote:

I had some queries about the spread in general and spread C API in  

1. How does the receive API call block? Does it busy wait or does it
go to sleep and wakes up when there is a message in the message box?
2. When SPREAD is used in different machines connected to the
internet, how does the message passing happen over the internet? (How
does the networking happen and does it happen between the local
daemons running on the different machines connected to spread?)
Shashank Yaduvanshi
B.Tech, Computer Science Department,
I.I.T. Delhi, India

Spread-users mailing list
Spread-users at lists.spread.org

More information about the Spread-users mailing list