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
{{ message }}
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.
I've been experimenting with QL's transactions and it seems like it does not handle concurrent DB.Begin() calls on the same database in a concurrent manner.
In the following example I simulate multiple goroutines opening the same database and beginning transactions within that database.
The effect of this, besides slower benchmarks, is not being able to benefit a lot from concurrency, because at the end every transaction has to be executed sequentially from start to end; besides if a transaction takes a long time it will delay all the other transactions.
I understand that transactions are essentially sequential anyways and that this lock is required in order to keep consistency, but what about moving the lock to Commit() (which does the actual writing) instead of having it on Begin()?
The text was updated successfully, but these errors were encountered:
Hello @cznic,
I've been experimenting with QL's transactions and it seems like it does not handle concurrent DB.Begin() calls on the same database in a concurrent manner.
In the following example I simulate multiple goroutines opening the same database and beginning transactions within that database.
Regardless of the concurrent nature of the program, beginning a transaction is always sequential:
I also tried with SQLite, MySQL and PostgreSQL and they allow multiple concurrent transactions on the same database (which is what I was expecting):
The effect of this, besides slower benchmarks, is not being able to benefit a lot from concurrency, because at the end every transaction has to be executed sequentially from start to end; besides if a transaction takes a long time it will delay all the other transactions.
I understand that transactions are essentially sequential anyways and that this lock is required in order to keep consistency, but what about moving the lock to
Commit()
(which does the actual writing) instead of having it onBegin()
?The text was updated successfully, but these errors were encountered: