Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Thaxll
· 1y ago · 0 comments
This is not a thread safety issue though, this is a transaction problem.
Comments
[–]
masklinn
1y ago
It’s absolutely a thread safety issue. It’s not a data race, but it’s a race condition and can very much cause unexpected behaviour e.g. out of bounds error even though on its face it has the correct preconditions.
[–]
hassleblad23
1y ago
Wrapping these 2 statements in a transaction will not solve this particular issue unless the transactions are run sequentially.