PyDbLite icon indicating copy to clipboard operation
PyDbLite copied to clipboard

Problems under multithreading

Open Neo-python opened this issue 5 years ago • 0 comments

KeyError occurs when multiple threads execute the following code at the same time.

    for i in range(1, 100 * (10 ** n)):
        common.ram.insert(uuid=i)
        common.ram._uuid[i]

` File "/Users/neo/work/socket_server/service/main.py", line 72, in message common.ram._uuid[i]

File "/Users/neo/work/socket_server/venvs/rsa_plugins/lib/python3.6/site-packages/pydblite/pydblite.py", line 104, in getitem return [self.db.records[_id] for _id in ids]

File "/Users/neo/work/socket_server/venvs/rsa_plugins/lib/python3.6/site-packages/pydblite/pydblite.py", line 104, in return [self.db.records[_id] for _id in ids] KeyError: 116611 `

Neo-python avatar Mar 26 '19 01:03 Neo-python