Throughout the Qt documentation, the terms reentrant and thread-safe are used to specify how a function can be used in multithreaded applications: - A reentrant function can be called simultaneously by multiple threads provided that each invocation of the function references unique data.
- A thread-safe function can be called simultaneously by multiple threads when each invocation references shared data. All access to the shared data is serialized.
By extension, a class is said to be reentrant if any of its functions can be called simultaneously by multiple threads on different instances of the class, and thread-safe if it even works if the different threads operate on the same instance. |