EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EMA in Multi-Threaded Applications

By providing thread safe and thread aware implementation, EMA enables application developers to take full advantage of multi-core processors and their scalability. On the same token, EMA enables developers to design multi-threaded applications that best meet their business needs. While designing a multi-threaded EMA application one must consider concurrent accessibility of EMA methods from different threads of control. The following information is used to identify this capability of each EMA method.

Depending on whether or not a concurrent access to EMA method is allowed and how, EMA methods may be grouped into three categories:

Object Level Thread Safe Method

Multiple application threads of control may concurrently call this method on the same instance. Applications will, however, incur the cost of synchronization overhead (e.g., blocking) while calling this method. By synchronizing concurrent access to this method on per instance basis, EMA preserves the state of individual instances and resolves any race condition that may arise while multiple application threads of control concurrently call this method on the same instance.

Class Level Thread Safe Method

Multiple application threads of control may concurrently call this method across all instances. Applications will, however, incur the cost of synchronization overhead (e.g., blocking) while calling this method. By synchronizing concurrent access to this method on per class basis, EMA preserves the state of all instances and resolves any race condition that may arise while multiple application threads of control concurrently call this method.

Lock-free Method

Single application thread of control may call such methods on an instance incurring no cost of synchronization overhead. EMA does not synchronize access to this method. Concurrent access to the same instance using this method may result in an undefined behaviour.

EMA method that is considered a thread safe method is explicitly and respectively marked as such in this Reference Manual. If there is no thread safety marking on a method, this method is considered a Lock-free Method.

Please see EMA Developer Guide for more details.