shelve and concurrency

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

    #1

    shelve and concurrency

    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

Working...