MROW Locking

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Prateek

    #1

    MROW Locking

    Can anyone direct me to a good resource on how to do MROW Locking
    efficiently in Python. The recipe at http://aspn.activestate.com/ASPN/Coo.../Recipe/413393
    is actually quite inefficient (not sure if it is the code or MROW
    itself).

    I have a dictionary (a cache lets say or some sort of index) which
    needs to be accessed by multiple threads. Most of the time its just
    being read. Very rarely, I have to iterate over it (sometimes writing,
    mostly reading), sometimes I have to update a single entry or multiple
    entries (ala dict.update()). I'd like to know the best way to make
    this happen (i.e. is MROW really what I am looking for or is there
    something else?).

    Is there a good way to do this using the in-built Lock and RLock
    objects?
    This project is part of a commercial database product.

    Prateek

Working...