Using Threads with the RTclient API


As described in Using Threads With Connections, multithreading is an effective technique for SmartSockets applications. RTclients can be multithreaded as well, using a warm or full connection to RTserver for high-level synchronization.

In addition to the synchronization properties incorporated into each connection, the RTserver connection is protected by an additional read/write mutex. This extra level of synchronization enables one thread in an RTclient to change the state of the RTserver connection without interfering with the other threads sharing the connection. Operations that do not affect the state of the RTserver connection are performed with only a read-lock on the read/write mutex and may thus run concurrently, while operations that do affect the state acquire a write-lock.

Working with threads in an RTclient is very similar to working with threads in peer-to-peer connections. The source code files, rtsvcp.c and rtsvcc.c, illustrating load balancing and threads are located in these directories:

UNIX:
$RTHOME/examples/smrtsock/manual  
OpenVMS:
RTHOME:[EXAMPLES.SMRTSOCK.MANUAL] 
Windows:
%RTHOME%\examples\smrtsock\manual 

TIBCO SmartSockets™ User’s Guide
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com