Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems under multithreading #4

Open
Neo-python opened this issue Mar 26, 2019 · 0 comments
Open

Problems under multithreading #4

Neo-python opened this issue Mar 26, 2019 · 0 comments

Comments

@Neo-python
Copy link

Neo-python commented Mar 26, 2019

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
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant