File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,16 @@ Restrictions
134134 the database to refuse updates.
135135
136136* The :mod: `shelve ` module does not support *concurrent * read/write access to
137- shelved objects. (Multiple simultaneous read accesses are safe.) When a
137+ shelved objects, whether from different programs or different threads within
138+ the same program. (Multiple simultaneous read accesses are safe.) When a
138139 program has a shelf open for writing, no other program should have it open for
139- reading or writing. Unix file locking can be used to solve this, but this
140- differs across Unix versions and requires knowledge about the database
140+ reading or writing. Additionally, within a single program, concurrent access
141+ from multiple threads is not supported and may lead to data corruption,
142+ unexpected behavior, or crashes. This affects all writing operations including
143+ assignment, deletion, :meth: `~Shelf.sync `, and :meth: `~Shelf.reorganize `.
144+ Even with :attr: `writeback ` set to :const: `True `, thread-safety is not
145+ guaranteed. Unix file locking can be used to solve cross-program concurrency,
146+ but this differs across Unix versions and requires knowledge about the database
141147 implementation used.
142148
143149* On macOS :mod: `dbm.ndbm ` can silently corrupt the database file on updates,
You can’t perform that action at this time.
0 commit comments