Skip to content

created the infrastructure for concurrent queues #97

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

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2cdd844
created the infrastructure for concurrent queues
dietmarkuehl Dec 1, 2024
e023c2e
clean-up some included headers which caused a bit of grief
dietmarkuehl Dec 1, 2024
42e952a
implemented all but the async interface
dietmarkuehl Dec 1, 2024
7fa110f
added async_push functionality
dietmarkuehl Dec 2, 2024
3bc6553
added async_pop
dietmarkuehl Dec 2, 2024
1faeac7
refactored how the bounded_queue works
dietmarkuehl Dec 3, 2024
f3f2c38
fixed a race
dietmarkuehl Dec 3, 2024
f23e722
try to working around an MSVC++ problem
dietmarkuehl Dec 3, 2024
69ba1e0
another attempt at working around an MSVC++ problem with local classes
dietmarkuehl Dec 3, 2024
c2ef01a
addressed gcc warnings
dietmarkuehl Dec 3, 2024
b9cb7c9
addressed more gcc warnings
dietmarkuehl Dec 4, 2024
7c2d57e
a few more warnings addressed
dietmarkuehl Dec 4, 2024
0ec7565
addressed a remaining warning
dietmarkuehl Dec 4, 2024
d9cf895
Build with TSAN and clang-tidy (#100)
ClausKlein Dec 4, 2024
683fc66
fixed new clang-tidy warnings
dietmarkuehl Dec 4, 2024
8cb53dd
more warnings
dietmarkuehl Dec 4, 2024
38d3f5b
addressed more clang-tidy warnings
dietmarkuehl Dec 5, 2024
2ab503a
suppressing a seemingly spurious analyser warning
dietmarkuehl Dec 5, 2024
bd52128
trying to skip over errors from unknown options
dietmarkuehl Dec 5, 2024
c0bf0bd
exec.awaitables: fix completion sigs for void awaitables (#96)
maikel Dec 1, 2024
0c3ae22
Remove unused print header in test (#99)
maikel Dec 2, 2024
65983ef
Add pre-commit hooks (#102)
ClausKlein Dec 11, 2024
73872dc
Check and format json and c++ files (#103)
ClausKlein Dec 13, 2024
ee2bdae
Fix clang tidy warnings (#105)
dietmarkuehl Dec 22, 2024
8a9686b
fixed the return type of getting an element from an rvalue product_ty…
dietmarkuehl Dec 22, 2024
01af87e
beman.execution26: change library status to under development (#104)
RaduNichita Dec 22, 2024
fc84954
Fix missing environment in sync_wait (#108)
maikel Dec 23, 2024
35b7067
Change exported install name to beman::execution26 (#109)
maikel Dec 23, 2024
9c1d681
Add on algorithm (#110)
dietmarkuehl Jan 4, 2025
7b135bd
fixed a few coroutine related issues (#113)
dietmarkuehl Jan 9, 2025
9e4bfb3
Fix coro issues (#114)
dietmarkuehl Jan 10, 2025
4631504
simplied gather signatures (#116)
dietmarkuehl Jan 13, 2025
21f0348
fix warnings (#117)
dietmarkuehl Jan 13, 2025
e3887dc
tried to reduce the uses of sender_decompose (#118)
dietmarkuehl Jan 14, 2025
1992b3b
various minor fixes (#119)
dietmarkuehl Jan 14, 2025
bcf5bc9
avoid debug flags spilling into dependent projects (#120)
dietmarkuehl Jan 18, 2025
ae1ebe0
Avoid to export Debug flags (#121)
ClausKlein Jan 20, 2025
3f8066e
Add examples (#122)
dietmarkuehl Jan 20, 2025
4c4aa72
update .clang-tidy and CMakeLists.txt
dietmarkuehl Jan 21, 2025
42ef6c3
fixed CMakeLists.txt
dietmarkuehl Jan 21, 2025
732953d
fixed a few issues introduced when rebasing
dietmarkuehl Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cancelled
copyable
pullrequest
snd
statics
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ builtin = clear,rare,en-GB_to_en-US,names,informal,code
check-hidden =
skip = ./.git,./build/*,./stagedir/*,./docs/html/*,./docs/latex/*,*.log,.*.swp,*~,*.bak,Makefile
quiet-level = 2
# ignore-words = .ignore-words
ignore-words = .codespellignore
30 changes: 13 additions & 17 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp

{
"name": "Beman Project Generic Devcontainer",
"build": {
"dockerfile": "Dockerfile"
},
"postCreateCommand": "bash .devcontainer/postcreate.sh",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools"
]
}
}
"name": "Beman Project Generic Devcontainer",
"build": {
"dockerfile": "Dockerfile"
},
"postCreateCommand": "bash .devcontainer/postcreate.sh",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools"
]
}
}
}
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
# Codeowners for reviews on PRs

* @dietmarkuehl @camio @neatudarius

43 changes: 43 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Lint Check (pre-commit)

on:
pull_request:
push:

jobs:
pre-commit:
runs-on: ubuntu-latest
name: pre-commit
permissions:
contents: read
checks: write
issues: write
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13

- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v45

# See:
# https://github.com/tj-actions/changed-files?tab=readme-ov-file#using-local-git-directory-
- uses: pre-commit/[email protected]
with:
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
continue-on-error: true

- name: suggester / pre-commit
if: ${{ github.event_name == 'pull_request' }}
uses: reviewdog/action-suggester@v1
with:
tool_name: pre-commit
level: warning
reviewdog_flags: "-fail-level=error"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ CMakeCache.txt
CMakeFiles/

docs/html
docs/latex
docs/latex
9 changes: 9 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md033.md
# Disable inline html linter is needed for <details> <summary>
MD033: false

# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md013.md
# Conforms to .clang-format ColumnLimit
# Update the comment in .clang-format if we no-longer tie these two column limits.
MD013:
line_length: 119
42 changes: 42 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- id: check-yaml
exclude: ^\.clang-(format|tidy)$
- id: check-added-large-files

# This brings in a portable version of clang-format.
# See also: https://github.com/ssciwr/clang-format-wheel
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.4
hooks:
- id: clang-format
types_or: [c++, c, json]
exclude: docs/TODO.json

# TODO: CMake linting and formatting
# - repo: https://github.com/BlankSpruce/gersemi
# rev: 0.17.1
# hooks:
# - id: gersemi
# name: CMake linting

# TODO: Markdown linting
# Config file: .markdownlint.yaml
# - repo: https://github.com/igorshubovych/markdownlint-cli
# rev: v0.43.0
# hooks:
# - id: markdownlint

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
files: ^.*\.(cmake|cpp|hpp|txt|md|json|in|yaml|yml)$
args: ["--ignore-words", ".codespellignore" ]
35 changes: 30 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,35 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
endif()

set(TARGET_NAME execution26)
set(TARGET_NAMESPACE beman) # FIXME: not used in install(EXPORT ...) CK?
set(TARGET_NAMESPACE beman)
set(TARGET_PREFIX ${TARGET_NAMESPACE}.${TARGET_NAME})
set(TARGET_LIBRARY ${PROJECT_NAME})
set(TARGET_ALIAS ${TARGET_LIBRARY}::${TARGET_LIBRARY})
set(TARGET_ALIAS ${TARGET_NAMESPACE}::${TARGET_NAME})
set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config)
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets)

option(
BEMAN_EXECUTION26_ENABLE_TESTING
"Enable building tests and test infrastructure. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)

option(
BEMAN_EXECUTION26_BUILD_EXAMPLES
"Enable building examples. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)

option(
BEMAN_EXECUTION26_ENABLE_INSTALL
"Install the project components. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
)

include(GNUInstallDirs)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

if(CMAKE_BUILD_TYPE STREQUAL Debug)
if(NOT BEMAN_EXECUTION26_ENABLE_INSTALL OR CMAKE_SKIP_INSTALL_RULES)
include(FetchContent)

# Add project_options from https://github.com/aminya/project_options
Expand All @@ -40,7 +58,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug)
# uncomment to enable the options. Some of them accept one or more inputs:
project_options(
PREFIX
${PROJECT_NAME}
${TARGET_NAME}
ENABLE_CACHE
# NO! # ENABLE_CLANG_TIDY
# NO! ENABLE_VS_ANALYSIS
Expand Down Expand Up @@ -73,13 +91,20 @@ endif()

add_subdirectory(src/beman/execution26)

if(PROJECT_IS_TOP_LEVEL)
if(BEMAN_EXECUTION26_ENABLE_TESTING)
enable_testing()

add_subdirectory(tests/beman/execution26)
endif()

if(BEMAN_EXECUTION26_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

if(NOT BEMAN_EXECUTION26_ENABLE_INSTALL OR CMAKE_SKIP_INSTALL_RULES)
return()
endif()

include(CMakePackageConfigHelpers)

write_basic_package_version_file(
Expand Down
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SANITIZERS := run
# SANITIZERS += asan # TODO: tsan msan
# endif

.PHONY: default release debug doc run update check ce todo distclean clean codespell clang-tidy build test install all format $(SANITIZERS)
.PHONY: default release debug doc run update check ce todo distclean clean codespell clang-tidy build test install all format unstage $(SANITIZERS)

SYSROOT ?=
TOOLCHAIN ?=
Expand Down Expand Up @@ -79,7 +79,9 @@ doc:

build:
CC=$(CXX) cmake --fresh -G Ninja -S $(SOURCEDIR) -B $(BUILD) $(TOOLCHAIN) $(SYSROOT) \
-DCMAKE_CXX_COMPILER=$(CXX) # XXX -DCMAKE_CXX_FLAGS="$(CXX_FLAGS) $(SAN_FLAGS)"
-D CMAKE_EXPORT_COMPILE_COMMANDS=1 \
-D CMAKE_SKIP_INSTALL_RULES=1 \
-D CMAKE_CXX_COMPILER=$(CXX) # XXX -D CMAKE_CXX_FLAGS="$(CXX_FLAGS) $(SAN_FLAGS)"
cmake --build $(BUILD)

# NOTE: without install! CK
Expand Down Expand Up @@ -111,8 +113,8 @@ check:
done | tsort > /dev/null

build/$(SANITIZER)/compile_commands.json: $(SANITIZER)
clang-tidy: build/$(SANITIZER)/compile_commands.json
run-clang-tidy -p build/$(SANITIZER) tests examples
clang-tidy: $(BUILD)/compile_commands.json
run-clang-tidy -p $(BUILD) tests examples

codespell:
codespell -L statics,snd,copyable,cancelled
Expand All @@ -128,6 +130,9 @@ clang-format:
todo:
bin/mk-todo.py

unstage:
git restore --staged tests/beman/execution26/CMakeLists.txt

.PHONY: clean-doc
clean-doc:
$(RM) -r docs/html docs/latex
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-->
# beman.execution26: Building Block For Asynchronous Programs

<img src="https://github.com/bemanproject/beman/blob/main/images/logos/beman_logo-beman_library_under_development.png" style="width:5%; height:auto;">

`beman.execution26` provides the basic vocabulary for asynchronous
programming as well as important algorithms implemented in terms
of this vocabulary. The key entities of the vocabulary are:
Expand Down Expand Up @@ -33,7 +35,9 @@ e.g.:
completed.
- `bulk(...)` to executed execute work, potentially concurrently.

**Implements:** [`std::execution` (P2300)](http://wg21.link/p2300).
**Implements:** [`std::execution` (P2300R10)](http://wg21.link/P2300R10).

**Status**: [Under development and not yet ready for production use.](https://github.com/bemanproject/beman/blob/main/docs/BEMAN_LIBRARY_MATURITY_MODEL.md#under-development-and-not-yet-ready-for-production-use)

## Help Welcome!

Expand Down
2 changes: 1 addition & 1 deletion bin/update-cmake-headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_headers(dir):
}

file_set_re = re.compile(" *FILE_SET.*")
section_re = re.compile(" *\${TARGET_LIBRARY}_(?P<section>.*)_headers$")
section_re = re.compile(" *\${TARGET_NAME}_(?P<section>.*)_headers$")
header_re = re.compile(" *\${PROJECT_SOURCE_DIR}/include/beman/.*/.*\.hpp")

if len(sys.argv) != 2:
Expand Down
3 changes: 1 addition & 2 deletions cmake/CMakeLinuxPresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"name": "release-base-Linux",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wno-shadow -Wconversion -Wsign-conversion -Wcast-align -Wcast-qual -Woverloaded-virtual -Wformat=2 -Wno-error"
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"condition": {
"type": "notEquals",
Expand Down
2 changes: 1 addition & 1 deletion docs/TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ToDo
# ToDo

| Section | Code | Test | Doc | Comment |
| ------- |:----:|:----:|:---:| ------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/dependency.txt
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,4 @@ when_all_with_variant into_variant
when_all_with_variant when_all
with_awaitable_senders as_awaitable
write_env make_sender
write_env queryable
write_env queryable
Loading
Loading