shelve and concurrency

Michele Simionato michele.simionato at gmail.com
Sat Apr 9 01:31:46 EDT 2005


The standard library says:
"""
The shelve module does not support concurrent read/write access to
shelved objects. (Multiple simultaneous read accesses are safe.) When a
program has a shelf open for writing, no other program should have it
open for reading or writing.
"""

But what about threads? If a single program open a shelve and many
threads
try to write simultaneously to it, do I get an error? I would say yes,
but after various attempts, I cannot get it, at least on Linux, where
shelve is using dbhash as database. Can somebody share any light,
please?

    Michele Simionato




More information about the Python-list mailing list