On 05/16/2017 10:45 AM, Joshua Harlow wrote:
So fyi,
If you really want something like this:
Just use:
http://fasteners.readthedocs.io/en/latest/api/lock.html#fasteners.lock.ReaderWriterLock
And always get a write lock.
It is a slightly different way of getting those locks (via a context manager)
but the implementation underneath is a deque; so fairness should be assured in
FIFO order...
That might work as a local patch, but doesn't help the more general case of fair
locking in OpenStack. The alternative to adding fair locks in oslo would be to
add fairness code to all the various OpenStack services that use locking, which
seems to miss the whole point of oslo.
In the implementation above it might also be worth using one condition variable
per waiter, since that way you can wake up only the next waiter in line rather
than waking up everyone only to have all-but-one of them go back to sleep right
away.
Chris
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev