[Spread-users] Newbie questions: Distributed queues, synchronous messaging and multi-threading

John Schultz jschultz at commedia.cnds.jhu.edu
Wed Dec 3 13:37:40 EST 2003


I'll answer about what I know:

On Wed, 3 Dec 2003, Chatter Box wrote:

> 2). Has anyone ever used spread to build a fault tolerant group (across 
> machines)?. If so, could you please point me to some documentation/or 
> example that shows how to do this uding spread.
> 
Yes, this is one of the primary purposes of Spread.  Run a Spread
configuration with daemons on several machines and have clients connect to
those machines.  Clients can then join any group in the system.  If a
daemon or a client crashes/disconnects, then the rest of the system (and
groups) continues running.  Almost all of the documentation (e.g. - Spread 
User's Manual, etc.) covers this.

> 3). Is thread capable of blocking (synchronous) messaging?. If so, how is 
> this done ?
> 
Spread's architecture is publish-subscribe.  However, having a blocking
request-response behavior would be quite easy to implement.  

One way would be for your client to send a request to a group and block
until the associated response is received in the client's private group.

> 4). Is thread threadsafe (no pun intended!). Are there re-entrancy problems 
> when running  thread in different processing threads (probably sounds 
> confusing but I hope you understanding what I'm alluding to!)
> 
Spread can be thread safe.  You need to compile your application with 
_REENTRANT defined and link with the libtspread.a library.  Then you can 
have as many threads as you want send and receive from the same mailboxes.  

Sometimes you don't want to have more than one receiver though, because of
the strong orderings (e.g. - AGREED, SAFE) you get from Spread.  Using
multiple threads will destroy the strong ordering gurantees of these types
of messages.

-- 
John Lane Schultz
Spread Concepts LLC
Phn: 443 838 2200





More information about the Spread-users mailing list