Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Secure Communication Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

5.12 Multithreading, the Handle-Body Idiom, and the Secure Sockets Package

The Secure Sockets package is multithread-level-1 safe. All data structures used internally are protected by mutexes where appropriate. However, your application must protect the sharing of objects in your code. See Chapter 4, "The Synchronization Package," in the Threads Module User's Guide for more information about Rogue Wave synchronization objects.

The Secure Sockets package uses the handle-body idiom (see Chapter 7, "The Smart Pointer Package," in the Threads Module User's Guide). Most functions in the handle forward the call directly to the body. Calling the copy constructor or assignment operator on a handle object simply makes a copy of that handle, which points to the same body as the original. If these two handles are in different threads, you must use a mutex or another synchronization primitive to prevent multiple threads from simultaneously accessing the body.

The following classes use the handle-body idiom:

Class RWSecureSocketPackageInit uses a reference count that is not protected against multiple threads accessing or changing it. This class is used to initialize the Secure Sockets package, and is normally instantiated by the main thread well before any other threads exist. Multiple threads should never need to access instances of this class.

Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.