It is possible to upgrade a reader lock to a writer lock, by using the method upgrade_to_writer. Here is an example.
A user interface thread must remain responsive to user requests, and must not get bogged down in long computations.
Unless otherwise stated, the thread safety rules for the library are as follows:
Two threads can invoke a method or function concurrently on different objects, but not the same object.
It is unsafe for two threads to invoke concurrently methods or functions on the same object.
Specify that a parallel loop should recursively split its range until it cannot be subdivided further.
Template class for a queue with concurrent operations.