User-Level Native Thread Primitives (GThread) Library White Paper (G06.26+)
User-Level Native Thread Primitives (GThread Library) 03/31/2005
Hewlett-Packard Company--540065-001 Page 40 of 46
3.4. Mixed Models
It is possible for the same process to have some threads swapped and some static. This approach is
useful if some threads are frequently dispatched and have predictable stack sizes, while other threads are
less often dispatched but have unpredictable sizes. Using static threads for the often-dispatched threads
improves performance significantly, but the stack overflow detection and ability to resize the swap area
can be important for the less predictable threads.
Similarly, the use of master and peer protocol can be mixed. Only a swapped thread or the Main thread
can dispatch a swapped thread, as these use the Main stack. Therefore, it is convenient to operate the
Main thread as an unthreaded context. However, a static thread could dispatch another static thread
directly, and any other thread can dispatch the Main thread.
3.5. Checkpointing
In “passive” checkpointing, the backup process duplicates exactly the memory image of the primary.
Passive checkpointing of threads is very difficult, and is not known to occur among GThread clients.
Passive checkpointing in users of the standard C/C++ libraries is not supported because of difficulty
duplicating the heap.
In contemporary applications, it is common to achieve fault tolerance by relegating that responsibility to
middleware such as TMF and Tuxedo, which frees the application code from concern with the details of
process-pair paradigms. Therefore, there are no plans to support passive checkpointing of GThread
control blocks and thread stacks.
In “active” checkpointing, the primary process explicitly sends messages to the backup containing data
that must be known to both. Typical active checkpointing paradigms send records representing
transactions or updates; they do not transfer procedure activation records (stack frames), so threads
introduce no distinct issues.
In TNS or native TNS/R clients of GThread, it is possible in principle to checkpoint the current
activation records of inactive threads. However, application of such data in the backup process would
require corresponding threads to occur at exactly the same addresses. No instance of such a paradigm is
known. The TNS/E interfaces do not accommodate such an approach.