Multithread Safety
Rogue Wave defines three levels of thread safety, depending on how a class is implemented. These include unsafe, safe, and multithread-safe, as described below.
*Unsafe (MT-0) -- An MT-0 function, class, or library is not safe to use in a multithreaded application unless the application arranges for only one thread at a time to access or execute within that function, class or library. Unsafe functions, classes or libraries often contain either global or static data that is not protected, or make use of functions or classes that are not safe.
*Safe (MT-1) -- MT-1 code is reentrant. An MT-1 function, class, or library can be used in a multithreaded application, but may not be safely accessed by more than one thread at a time. If the code has any undocumented or private shared, global, or static data, it will automatically guard that data even across thread boundaries, so its behavior will be as expected: class instances will "act like an int" even in a multithreaded environment. Of course, if you share MT-1 objects between threads, you are responsible for avoiding race conditions.
*MT-Safe (MT-2) -- An MT-2 function, class, or library is fully prepared for multithreaded access and execution. MT-2 objects are reentrant, protect their internal global or static data, and ensure that methods that access member data are protected. An MT-2 class or library implies that individual operations can be performed safely without external user locking and unlocking. However, an MT-2 class or library might still require the user to perform external synchronization or locking in situations where several individual operations must be combined and treated as a single atomic operation (for example, testing for, and reading the contents of a queue).