Message263618
I think this behavior is due to the underlying behavior of the dbm. The same code using dbm, rather than shelve, also throws KeyErrors:
from multiprocessing import Process
import dbm
db = dbm.open("example.dbm", "c")
for i in range(100):
db[str(i)] = str(i ** 2)
def parallel():
for i in range(100):
print(db[str(i)])
a = Process(target = parallel)
b = Process(target = parallel)
a.start()
b.start()
a.join()
b.join() |
|
Date |
User |
Action |
Args |
2016-04-17 17:28:16 | Paul Ellenbogen | set | recipients:
+ Paul Ellenbogen, jnoller, sbt |
2016-04-17 17:28:16 | Paul Ellenbogen | set | messageid: <1460914096.07.0.170314253319.issue26773@psf.upfronthosting.co.za> |
2016-04-17 17:28:16 | Paul Ellenbogen | link | issue26773 messages |
2016-04-17 17:28:16 | Paul Ellenbogen | create | |
|