Skip to content

Commit 809b7a0

Browse files
committed
[Lock] Mention the priority policy of shared locks
1 parent d0abaf0 commit 809b7a0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/lock.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ to acquire the lock in a blocking mode::
237237
$lock = $factory->createLock('user'.$user->id);
238238
$lock->acquireRead(true);
239239

240+
.. note::
241+
242+
The `priority policy`_ of Symfony's shared locks depends on the underlying
243+
store (e.g. Redis store prioritizes readers vs writers).
244+
240245
When a read-only lock is acquired with the method ``acquireRead()``, it's
241246
possible to **promote** the lock, and change it to write lock, by calling the
242247
``acquire()`` method::
@@ -915,3 +920,4 @@ are still running.
915920
.. _`Replica Set Read and Write Semantics`: https://docs.mongodb.com/manual/applications/replication/
916921
.. _`ZooKeeper`: https://zookeeper.apache.org/
917922
.. _`readers–writer lock`: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock
923+
.. _`priority policy`: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Priority_policies

0 commit comments

Comments
 (0)