-
Notifications
You must be signed in to change notification settings - Fork 868
Convert ink_queue implementation to std::atomic #13170
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
Open
JosiahWI
wants to merge
38
commits into
apache:master
Choose a base branch
from
JosiahWI:refactor/std-atomic-ink-queue
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
0c35642
Convert ink_queue implementation to std::atomic
JosiahWI 581723b
Make changes suggested by Copilot
JosiahWI e059484
Make changes suggested by Copilot
JosiahWI f00b13e
Fix race condition with assertion
JosiahWI c3d8179
Link libatomic on all platforms but Apple
JosiahWI 2e2a846
Fix incorrect check for non-Apple platforms
JosiahWI fa61ef3
Implement complete cross-platform libatomic check
JosiahWI 4eeea4e
Disable std::atomic<__int128> on lacking platforms
JosiahWI c96a862
Do not link libatomic when not available
JosiahWI de95aa7
Base `TS_HAS_128BIT_CAS` on `__atomic` hardware
JosiahWI aa23166
Suppress freelist_new leaks in CI
JosiahWI 4773979
Assert proper atomiclist alignment
JosiahWI c1bf02b
Make changes suggested by Copilot
JosiahWI 6a6c19a
Make changes suggested by Copilot
JosiahWI 11df3e0
Do not use `FREELIST_POINTER` to read `void*`
JosiahWI ea92af6
Do not use `FREELIST_POINTER` for `void*` in tests
JosiahWI c0f63c0
Make changes suggested by Copilot
JosiahWI 71099a3
Fix syntax error
JosiahWI d103e37
Remove benchmarks in favor of existing ones
JosiahWI e19cafd
Revert 128bit CAS test changes
JosiahWI 7f8e7b7
Add 128bit atomic test in CMake for ink queue
JosiahWI 160a583
Make changes suggested by Copilot
JosiahWI 7ba52bf
Build `store_head` conditionally
JosiahWI 895d1b4
Require both `__sync` and `__swap` operations
JosiahWI 0623f85
Add `-mcx16` flag when needed for atomics
JosiahWI 43ab51f
Make changes suggested by Copilot
JosiahWI 18607e4
Make changes suggested by Copilot
JosiahWI bc02880
Fix typo in LSan suppression file
JosiahWI fe13bcd
Remove unprofessional phrase in comment
JosiahWI 1f8dc73
Include header for placement new
JosiahWI 1f4edc9
Fix leak suppression matching
JosiahWI 5acaee7
Mark freelist chunks as reachable memory for LSan
JosiahWI 8f242bf
Remove `freelist_new` LSan suppression
JosiahWI c8e05c9
Do not rely on operator short-circuiting in macros
JosiahWI b6f0f4b
Make changes suggested by Copilot
JosiahWI 23fdc0d
Potential fix for pull request finding
JosiahWI 9db8b81
Try out supposed lsan_ignore fix
JosiahWI 8549d85
Make changes suggested by Copilot
JosiahWI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| ####################### | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more contributor license | ||
| # agreements. See the NOTICE file distributed with this work for additional information regarding | ||
| # copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with the License. You may obtain | ||
| # a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software distributed under the License | ||
| # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
| # or implied. See the License for the specific language governing permissions and limitations under | ||
| # the License. | ||
| # | ||
| ####################### | ||
|
|
||
| # Check128BitAtomic.cmake | ||
| # | ||
| # This will define the following variables | ||
| # | ||
| # TS_HAS_128BIT_ATOMIC | ||
| # TS_NEEDS_MCX16_FOR_128BIT_ATOMIC | ||
| # | ||
|
|
||
| set(CHECK_PROGRAM | ||
| " | ||
| #include <atomic> | ||
|
|
||
| int main() | ||
| { | ||
| std::atomic<__int128> x{0}; | ||
| __int128 expected{x.load()}; | ||
| return x.compare_exchange_strong(expected, 10); | ||
| } | ||
| " | ||
| ) | ||
|
|
||
| include(CheckCXXSourceCompiles) | ||
| check_cxx_source_compiles("${CHECK_PROGRAM}" TS_HAS_128BIT_ATOMIC) | ||
|
|
||
| set(NEED_MCX16 FALSE) | ||
|
|
||
| if(NOT TS_HAS_128BIT_ATOMIC) | ||
| unset(TS_HAS_128BIT_ATOMIC CACHE) | ||
| set(CMAKE_REQUIRED_FLAGS "-Werror -mcx16") | ||
| check_cxx_source_compiles("${CHECK_PROGRAM}" TS_HAS_128BIT_ATOMIC) | ||
| set(NEED_MCX16 ${TS_HAS_128BIT_ATOMIC}) | ||
| unset(CMAKE_REQUIRED_FLAGS) | ||
| endif() | ||
|
|
||
| set(TS_NEEDS_MCX16_FOR_128BIT_ATOMIC | ||
| ${NEED_MCX16} | ||
| CACHE BOOL "Whether -mcx16 is needed to compile 128bit atomics" | ||
| ) | ||
|
|
||
| unset(CHECK_PROGRAM) | ||
| unset(NEED_MCX16) | ||
|
|
||
| mark_as_advanced(TS_HAS_128BIT_ATOMIC TS_NEEDS_MCX16_FOR_128BIT_ATOMIC) |
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.