We have implemented reader write lock with
typedef boost::unique_lock<boost::shared_mutex> WriterLock; typedef boost::shared_lock<boost::shared_mutex> ReadersLock;
where we have many multithreaded readers and only a few authors. Readers share access with other readers, but block records. Writer locks until it has exclusive access to the resource.
We could not find this in the acceleration documentation ... What is the Writer Hunger Prevention Policy?
For example, if there are many readers, all of whom block the lock from the thread pool, is there any guarantee upper limit on the number of lock attempts before the writer finally gets the lock?
We have seen performance indicators that seem to indicate that the record should wait until there are no readers, and there are rare cases when it is a long time, as new readers can request locks while the current readers are being served. In this case, it seems that in our code the writer should wait a very long time until there are no readings.
We would prefer a system with a large number of queues where, when a writer requests a lock, all current readers are reset, but all new incoming readers are blocked by the write request.
What is the behavior of the updated castle concept in Boost? Increase flows
There is no one way in which he handles the writer's hunger.
source share