You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Thank you for this nice library! Here is a bug report:
Currently, the databases are accessed using a singleton cursor. Due to the way the cursor is created, the database disallows accessing it from a thread that does not match the thread in which it was created. This may cause the creation of fields to fail if they are created from different threads.
Here is a code that reproduces the issue:
from threading import Thread
from galois import GF
if __name__ == '__main__':
field = GF(7)
t = Thread(target=lambda: GF(11), args=())
t.start()
t.join()
A possible fix would be to substitute the cls.conn = sqlite3.connect(cls.file)
with cls.conn = sqlite3.connect(cls.file, check_same_thread=False)
inside the constructor of galois._databases._interface.DatabaseInterface.
I believe that this is a safe thing to do, since there are no write operations to the database.
The text was updated successfully, but these errors were encountered:
Hello! Thank you for this nice library! Here is a bug report:
Currently, the databases are accessed using a singleton cursor. Due to the way the cursor is created, the database disallows accessing it from a thread that does not match the thread in which it was created. This may cause the creation of fields to fail if they are created from different threads.
Here is a code that reproduces the issue:
A possible fix would be to substitute the
cls.conn = sqlite3.connect(cls.file)
with
cls.conn = sqlite3.connect(cls.file, check_same_thread=False)
inside the constructor of
galois._databases._interface.DatabaseInterface
.I believe that this is a safe thing to do, since there are no write operations to the database.
The text was updated successfully, but these errors were encountered: