A class library for simple as well as complex thread communication, including Thread Method Invocation (TMI) and non-deterministic message acceptance.
The basic abstraction of this library is the interface MessageQueue which provides a basic set of methods for management of an input message queue of a receiver thread. This interface is extended by an abstract class AbstractMessageQueue that provides some default implementations and template methods. A message queue can realize one of three semantics

Read more about this library in the User's Guide.
Thread method invocation (TMI) is based on the concept of rendezvous in Ada, and is similar in semantics as RMI (remote method invocation). The only difference between TMI and RMI is that the latter is communication between address spaces using argument copying and the former is thread communication in the same address space with arguments passed by reference instead. A rendezvous message queue provides ability for a sending thread to both pass arguments to and receive return values from a server thread. Such a queue together with a proper public interface plus some internal logic for message administration, denotes a thread method.
If the number of thread methods is more than one, a message queue group must be used. A group object manages a set of message queues and provides non-deterministic message acceptance logic. The idea and implementation is inspired by the SELECT statement Ada. If the application state of a thread requires that only a subset of the available thread methods should be enabled, a guard object might be used.
The design of the TMI libray is described in a separate article. The article describes
step by step how to implement the library. The synopsis is problem driven, which means
that first is a problem formulated and demonstraded by a program, then is the root
cause analysed and finally is a solution presented and demonstrated by running the
demo program again, with the proper settings.
Click here to read the whole article.