MROW Locking

P

Prateek

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/Cookbook/Python/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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,057
Members
48,769
Latest member
Clifft

Latest Threads

Top