-
Notifications
You must be signed in to change notification settings - Fork 7
client: support multi-threading #114
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1934461
to
e522777
Compare
6182ffa
to
e23e678
Compare
d723f4f
to
3593238
Compare
aae1408
to
b3cc5d2
Compare
Mempool uses default implementations of move and copy semantics and it's not great - it owns resources, hence, trivial implementations are not appropriate. Let's implement convenient move constructor and operator. What's about copying ones, let's explicitly delete them - I can hardly imagine a case when one needs to copy an allocator instead of moving it. The move semantics in MempoolInstance is implemented as a simple swap so that the destructor of moved-from object will release resources that moved-to object owned before the move. All the newly introduced constructors and operators are explicitly marked as `noexcept` because thay actually are. Part of tarantool#110
Allocator can be not copyable, so it's better to consume it in constructor. It is needed because we are going to use non-copyable allocator for `Buffer` by default. Part of tarantool#110
Default implementations of move semantics are not suitable because buffer owns resources - let's implement proper ones. Note that the move cannot be implemented as a swap here because allocator, that is stored in the buffer, shouldn't be used after it is moved. Part of tarantool#110
Currently we use MempoolHolder as default allocator - it makes all buffers use the same MempoolInstance. This buffer cannot be used in Multi-Threaded scenarios, so let's simply use `MempoolInstance` instead - now each connection will use its own allocator. To reduce memory footprint of each connection, let's set default parameter `M = slab_size / block_size` to 16 to use 256KB slabs by default. Along the way, move a brace to the same line with `Buffer` class name to make it conform to our clang format. Part of tarantool#110
4252a54
to
de2104f
Compare
CuriousGeorgiy
approved these changes
Apr 15, 2025
The previous commits adapted Tntcxx for multithreaded execution - this adds a test for the scenario. Part of tarantool#110
We have a cmake option to build Tntcxx with sanitizers. Currently, only memory and UB sanitizers are used - let's populate the list with thread sanitizer since we have a test for a multithreaded scenario and use it on CI. Since address and thread sanitizers cannot be used together, existing cmake option `TNTCXX_ENABLE_SANITIZERS` is extended - now it accepts "address" and "thread" arguments to choose a sanitizer. Part of tarantool#110
Trailing whitespaces are never appreciated, so let's remove them all.
Just prettifying the readme.
The section describes how the connector should be used from several threads. Closes tarantool#110 Co-authored-by: Georgiy Lebedev <[email protected]>
We are using the first version of setup-tarantool action and it causes some problems - sometimes it just fails because the NodeJS version installed on the runner is too new for this old action. Let's simply use the third (the newest) version of this action - it behaves in the same way, but it is more stable.
@CuriousGeorgiy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The commit adapts connector to multithreaded scenarios and populates CI with thread sanitizer. See commits for details.
Closes #110