Skip to content

transaction: use AtomicU8 for status #429

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

Merged
merged 3 commits into from
Nov 1, 2023
Merged

Conversation

pingyu
Copy link
Collaborator

@pingyu pingyu commented Oct 31, 2023

Close #428

Changes

  • Use AtomicU8 for Transaction::status to avoid futures::executor::block_on in Transaction::drop. Besides, as status of transaction object is unlikely to have contention, atomic operations should have better performance.

Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Copy link
Member

@iosmanthus iosmanthus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pingyu pingyu merged commit a7885be into tikv:master Nov 1, 2023
bxq2011hust pushed a commit to FISCO-BCOS/tikv-client-rust that referenced this pull request Mar 22, 2024
* use AtomicU8 for status

Signed-off-by: Ping Yu <yuping@pingcap.com>

* fix check

Signed-off-by: Ping Yu <yuping@pingcap.com>

* skip exchange on equal

Signed-off-by: Ping Yu <yuping@pingcap.com>

---------

Signed-off-by: Ping Yu <yuping@pingcap.com>
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

Successfully merging this pull request may close these issues.

transaction: Transaction would be hanged in dropping.
2 participants