Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.56 KB

index.rst

File metadata and controls

54 lines (37 loc) · 1.56 KB

Readers/Writer Lock for Twisted

Twisted implementation of a Readers/Writer Lock.

This synchronization primitive allows to lock a share depending on two access roles: "reader" which only access to the data without modifying it, and "writer" which may want to change the data in the share.

RW Lock features:

  • Multiple readers can access to the data at the same time. There is no locking at all when only readers require access to the share
  • When a write requires access to the share, it prevents any new reader request to fullfil and put these requests into a waiting queue. It will wait for all ongoing reads to finish
  • Only one writer can act at the same time
  • This Lock is well suited for share with more readers than writer. Write requests must be at least an order of magnitude less often that read requests

This implementation brings this mechanism to the Twisted's deferred. Please note they are independent with other multithreading RW locks.

Indices and tables

  • genindex
  • modindex
  • search

Source Documentation

Readers/Writer Deferred Lock

txrwlock.TxReadersWriterLock

Readers/Writer Deferred Lock TestCase

txrwlock.TxTestCase