Skip to content

Commit 300a6a8

Browse files
committed
rename system_context to parallel_scheduler everywhere
1 parent 825d79c commit 300a6a8

22 files changed

+245
-184
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ AlwaysBreakAfterReturnType: None
2828
AlwaysBreakBeforeMultilineStrings: false
2929
AlwaysBreakTemplateDeclarations: Yes
3030
AttributeMacros: [
31-
STDEXEC_SYSTEM_CONTEXT_INLINE
31+
STDEXEC_PARALLEL_SCHEDULER_INLINE
3232
STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS
3333
]
3434
BinPackArguments: false

.clang-tidy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ ImplementationFileExtensions:
1111
- cpp
1212
- cu
1313
HeaderFilterRegex: '^.*[.](h|hpp|cuh)$'
14-
ExcludeHeaderFilterRegex: '^.*__system_context_default_impl_entry[.]hpp$'
14+
ExcludeHeaderFilterRegex: '^.*__parallel_scheduler_default_impl_entry[.]hpp$'
1515
FormatStyle: none
1616
User: eniebler
1717
ExtraArgsBefore: [
18-
'-DSTDEXEC_SYSTEM_CONTEXT_HEADER_ONLY=1',
18+
'-DSTDEXEC_PARALLEL_SCHEDULER_HEADER_ONLY=1',
1919
'-DSTDEXEC_CLANG_TIDY_INVOKED=1',
2020
]
2121
CheckOptions:

.clangd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ CompileFlags:
2121

2222
# The following file assumes a define.
2323
If:
24-
PathMatch: .*/__system_context_default_impl_entry\.hpp
24+
PathMatch: .*/__parallel_scheduler_default_impl_entry\.hpp
2525
CompileFlags:
2626
Add:
27-
- "-DSTDEXEC_SYSTEM_CONTEXT_INLINE=inline"
27+
- "-DSTDEXEC_PARALLEL_SCHEDULER_INLINE=inline"
2828

2929
---
3030

CMakeLists.txt

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -436,23 +436,29 @@ if (STDEXEC_ENABLE_NUMA)
436436
target_compile_definitions(stdexec INTERFACE STDEXEC_ENABLE_NUMA)
437437
endif()
438438

439-
option(STDEXEC_BUILD_SYSTEM_CONTEXT "Build the system_context compiled library" OFF)
439+
option(STDEXEC_BUILD_PARALLEL_SCHEDULER "Build the parallel_scheduler compiled library" OFF)
440+
if (DEFINED STDEXEC_BUILD_SYSTEM_CONTEXT)
441+
message(DEPRECATION "STDEXEC_BUILD_SYSTEM_CONTEXT is deprecated. Use STDEXEC_BUILD_PARALLEL_SCHEDULER instead.")
442+
set(STDEXEC_BUILD_PARALLEL_SCHEDULER ${STDEXEC_BUILD_SYSTEM_CONTEXT})
443+
endif()
440444

441-
if(STDEXEC_BUILD_SYSTEM_CONTEXT)
442-
set(SYSTEM_CONTEXT_SOURCES src/system_context/system_context.cpp)
443-
add_library(system_context ${SYSTEM_CONTEXT_SOURCES})
444-
target_compile_features(system_context PUBLIC cxx_std_20)
445-
set_target_properties(system_context PROPERTIES
445+
if(STDEXEC_BUILD_PARALLEL_SCHEDULER)
446+
set(STDEXEC_PARALLEL_SCHEDULER_SOURCES src/parallel_scheduler/parallel_scheduler.cpp)
447+
add_library(parallel_scheduler ${STDEXEC_PARALLEL_SCHEDULER_SOURCES})
448+
target_compile_features(parallel_scheduler PUBLIC cxx_std_20)
449+
set_target_properties(parallel_scheduler PROPERTIES
446450
CXX_STANDARD 20
447451
CXX_STANDARD_REQUIRED ON
448452
CXX_EXTENSIONS OFF)
449-
target_compile_options(system_context PUBLIC
453+
target_compile_options(parallel_scheduler PUBLIC
450454
$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/Zc:__cplusplus /Zc:preprocessor /Zc:externConstexpr>
451455
)
452-
add_library(STDEXEC::system_context ALIAS system_context)
453-
target_link_libraries(system_context PUBLIC stdexec)
454-
endif()
456+
target_link_libraries(parallel_scheduler PUBLIC stdexec)
455457

458+
add_library(STDEXEC::parallel_scheduler ALIAS parallel_scheduler)
459+
add_library(system_context ALIAS parallel_scheduler)
460+
add_library(STDEXEC::system_context ALIAS parallel_scheduler)
461+
endif()
456462

457463
option(STDEXEC_ENABLE_IO_URING "Enable the use of the io_uring scheduler on Linux" OFF)
458464

@@ -518,8 +524,8 @@ if(STDEXEC_INSTALL)
518524
include(CPack)
519525

520526
set(stdexec_install_targets stdexec)
521-
if(STDEXEC_BUILD_SYSTEM_CONTEXT)
522-
list(APPEND stdexec_install_targets system_context)
527+
if(STDEXEC_BUILD_PARALLEL_SCHEDULER)
528+
list(APPEND stdexec_install_targets parallel_scheduler)
523529
endif()
524530

525531
install(TARGETS ${stdexec_install_targets}

conanfile.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ class StdexecPackage(ConanFile):
1515

1616
settings = "os", "arch", "compiler", "build_type"
1717
options = {
18+
# Legacy name for backward compatibility. Use parallel_scheduler instead.
1819
"system_context": [True, False],
20+
"parallel_scheduler": [True, False],
1921
}
2022
default_options = {
2123
"system_context": False,
24+
"parallel_scheduler": False,
2225
}
2326
exports_sources = (
2427
"include/*",
@@ -32,6 +35,8 @@ class StdexecPackage(ConanFile):
3235

3336
def configure(self):
3437
if self.options.system_context:
38+
self.options.parallel_scheduler = True
39+
if self.options.parallel_scheduler:
3540
self.package_type = "static-library"
3641
else:
3742
self.package_type = "header-library"
@@ -49,19 +54,19 @@ def layout(self):
4954

5055
def build(self):
5156
tests = "OFF" if self.conf.get("tools.build:skip_test", default=False) else "ON"
52-
system_context = "ON" if self.options.system_context else "OFF"
57+
parallel_scheduler = "ON" if self.options.parallel_scheduler else "OFF"
5358

5459
cmake = CMake(self)
5560
cmake.configure(variables={
5661
"STDEXEC_BUILD_TESTS": tests,
5762
"STDEXEC_BUILD_EXAMPLES": tests,
58-
"STDEXEC_BUILD_SYSTEM_CONTEXT": system_context,
63+
"STDEXEC_BUILD_PARALLEL_SCHEDULER": parallel_scheduler,
5964
})
6065
cmake.build()
6166
cmake.test()
6267

6368
def package_id(self):
64-
if not self.info.options.system_context:
69+
if not self.info.options.parallel_scheduler:
6570
# Clear settings because this package is header-only.
6671
self.info.clear()
6772

@@ -73,8 +78,8 @@ def package_info(self):
7378
self.cpp_info.set_property("cmake_file_name", "P2300")
7479
self.cpp_info.set_property("cmake_target_name", "P2300::P2300")
7580
self.cpp_info.set_property("cmake_target_aliases", ["STDEXEC::stdexec"])
76-
if self.options.system_context:
77-
self.cpp_info.components["system_context"].libs = ["system_context"]
78-
self.cpp_info.components["system_context"].set_property(
79-
"cmake_target_name", "STDEXEC::system_context"
81+
if self.options.parallel_scheduler:
82+
self.cpp_info.components["parallel_scheduler"].libs = ["parallel_scheduler"]
83+
self.cpp_info.components["parallel_scheduler"].set_property(
84+
"cmake_target_name", "STDEXEC::parallel_scheduler"
8085
)

docs/Doxyfile.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2368,8 +2368,8 @@ INCLUDE_FILE_PATTERNS =
23682368
PREDEFINED = "__cplusplus=202302L" \
23692369
"STDEXEC_DOXYGEN_INVOKED=1" \
23702370
"STDEXEC=stdexec" \
2371-
"STDEXEC_SYSTEM_CONTEXT_HEADER_ONLY=1" \
2372-
"STDEXEC_SYSTEM_CONTEXT_INLINE=inline" \
2371+
"STDEXEC_PARALLEL_SCHEDULER_HEADER_ONLY=1" \
2372+
"STDEXEC_PARALLEL_SCHEDULER_INLINE=inline" \
23732373
"STDEXEC_ATTRIBUTE(X)= " \
23742374
"STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS= " \
23752375
"STDEXEC_AUTO_RETURN(...)=->decltype(auto){ return __VA_ARGS__; }" \
@@ -2816,4 +2816,4 @@ CLANG_DATABASE_PATH = "@COMPILATION_DB_PATH@"
28162816
CLANG_OPTIONS = -isystem "@STDDEF_INCLUDE_PATH@" \
28172817
-std=c++23 \
28182818
-DSTDEXEC_DOXYGEN_INVOKED=1 \
2819-
-DSTDEXEC_SYSTEM_CONTEXT_HEADER_ONLY=1
2819+
-DSTDEXEC_PARALLEL_SCHEDULER_HEADER_ONLY=1

examples/hello_world.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ using stdexec::sync_wait;
2525

2626
auto main() -> int
2727
{
28-
exec::numa_policy numa{exec::no_numa_policy{}};
2928
exec::static_thread_pool ctx{8};
3029
scheduler auto sch = ctx.get_scheduler(); // 1
3130

include/exec/any_sender_of.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ namespace experimental::execution
560560
// Adds the get_completion_scheduler_t<set_value_t> query to the type-erased sender's
561561
// attributes. This type is used for the return of any_scheduler::schedule.
562562
template <class AnyScheduler, class AnySender>
563-
struct _any_schedule_sender : AnySender
563+
struct _any_schedule_sender final : AnySender
564564
{
565565
private:
566566
using _any_receiver_ref_t = AnySender::_any_receiver_ref_t;

include/exec/detail/system_context_replaceability_api.hpp

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,56 +18,62 @@
1818
#define STDEXEC_SYSTEM_CONTEXT_REPLACEABILITY_API_H
1919

2020
#include "../../stdexec/__detail/__execution_fwd.hpp"
21-
#include "../../stdexec/__detail/__system_context_replaceability_api.hpp"
21+
#include "../../stdexec/__detail/__parallel_scheduler_replacement_api.hpp"
2222

2323
#include <memory>
2424

25-
namespace experimental::execution::system_context_replaceability
25+
namespace experimental::execution
2626
{
27-
using STDEXEC::system_context_replaceability::__parallel_scheduler_backend_factory_t;
27+
namespace [[deprecated("Use the STDEXEC::parallel_scheduler_replacement namespace "
28+
"instead.")]] system_context_replaceability
29+
{
30+
using STDEXEC::parallel_scheduler_replacement::__parallel_scheduler_backend_factory_t;
2831

29-
/// Interface for the parallel scheduler backend.
30-
using parallel_scheduler_backend
31-
[[deprecated("Use STDEXEC::system_context_replaceability::parallel_scheduler_backend "
32-
"instead.")]] = STDEXEC::system_context_replaceability::parallel_scheduler_backend;
32+
/// Interface for the parallel scheduler backend.
33+
using parallel_scheduler_backend //
34+
[[deprecated("Use STDEXEC::parallel_scheduler_replacement::parallel_scheduler_backend "
35+
"instead.")]] = //
36+
STDEXEC::parallel_scheduler_replacement::parallel_scheduler_backend;
3337

34-
/// Get the backend for the parallel scheduler.
35-
/// Users might replace this function.
36-
[[deprecated("Use STDEXEC::system_context_replaceability::query_parallel_scheduler_backend "
37-
"instead.")]]
38-
inline auto query_parallel_scheduler_backend()
39-
-> std::shared_ptr<STDEXEC::system_context_replaceability::parallel_scheduler_backend>
40-
{
41-
return STDEXEC::system_context_replaceability::query_parallel_scheduler_backend();
42-
}
38+
/// Get the backend for the parallel scheduler.
39+
/// Users might replace this function.
40+
[[deprecated("Use STDEXEC::parallel_scheduler_replacement::query_parallel_scheduler_backend "
41+
"instead.")]]
42+
inline auto query_parallel_scheduler_backend()
43+
-> std::shared_ptr<STDEXEC::parallel_scheduler_replacement::parallel_scheduler_backend>
44+
{
45+
return STDEXEC::parallel_scheduler_replacement::query_parallel_scheduler_backend();
46+
}
4347

44-
STDEXEC_PRAGMA_PUSH()
45-
STDEXEC_PRAGMA_IGNORE_GNU("-Wdeprecated-declarations")
46-
STDEXEC_PRAGMA_IGNORE_MSVC(4996) // warning C4996: 'function': was declared deprecated
47-
STDEXEC_PRAGMA_IGNORE_EDG(deprecated_entity)
48-
/// Set a factory for the parallel scheduler backend.
49-
/// Can be used to replace the parallel scheduler at runtime.
50-
/// Out of spec.
51-
[[deprecated("Use STDEXEC::system_context_replaceability::set_parallel_scheduler_backend "
52-
"instead.")]]
53-
inline auto set_parallel_scheduler_backend(__parallel_scheduler_backend_factory_t __new_factory)
54-
-> __parallel_scheduler_backend_factory_t
55-
{
56-
return STDEXEC::system_context_replaceability::set_parallel_scheduler_backend(__new_factory);
57-
}
58-
STDEXEC_PRAGMA_POP()
48+
STDEXEC_PRAGMA_PUSH()
49+
STDEXEC_PRAGMA_IGNORE_GNU("-Wdeprecated-declarations")
50+
STDEXEC_PRAGMA_IGNORE_MSVC(4996) // warning C4996: 'function': was declared deprecated
51+
STDEXEC_PRAGMA_IGNORE_EDG(deprecated_entity)
52+
STDEXEC_PRAGMA_IGNORE_EDG(deprecated_entity_with_custom_message)
53+
/// Set a factory for the parallel scheduler backend.
54+
/// Can be used to replace the parallel scheduler at runtime.
55+
/// Out of spec.
56+
[[deprecated("Use STDEXEC::parallel_scheduler_replacement::set_parallel_scheduler_backend "
57+
"instead.")]]
58+
inline auto set_parallel_scheduler_backend(__parallel_scheduler_backend_factory_t __new_factory)
59+
-> __parallel_scheduler_backend_factory_t
60+
{
61+
return STDEXEC::parallel_scheduler_replacement::set_parallel_scheduler_backend(__new_factory);
62+
}
63+
STDEXEC_PRAGMA_POP()
5964

60-
/// Interface for completing a sender operation. Backend will call frontend though this interface
61-
/// for completing the `schedule` and `schedule_bulk` operations.
62-
using receiver
63-
[[deprecated("Use STDEXEC::system_context_replaceability::receiver_proxy "
64-
"instead.")]] = STDEXEC::system_context_replaceability::receiver_proxy;
65+
/// Interface for completing a sender operation. Backend will call frontend though this interface
66+
/// for completing the `schedule` and `schedule_bulk` operations.
67+
using receiver
68+
[[deprecated("Use STDEXEC::parallel_scheduler_replacement::receiver_proxy "
69+
"instead.")]] = STDEXEC::parallel_scheduler_replacement::receiver_proxy;
6570

66-
/// Receiver for bulk scheduling operations.
67-
using bulk_item_receiver
68-
[[deprecated("Use STDEXEC::system_context_replaceability::bulk_item_receiver_proxy "
69-
"instead.")]] = STDEXEC::system_context_replaceability::bulk_item_receiver_proxy;
70-
} // namespace experimental::execution::system_context_replaceability
71+
/// Receiver for bulk scheduling operations.
72+
using bulk_item_receiver [[deprecated(
73+
"Use STDEXEC::parallel_scheduler_replacement::bulk_item_receiver_proxy "
74+
"instead.")]] = STDEXEC::parallel_scheduler_replacement::bulk_item_receiver_proxy;
75+
} // namespace system_context_replaceability
76+
} // namespace experimental::execution
7177

7278
namespace exec = experimental::execution;
7379

include/stdexec/__detail/__config.hpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,18 @@
179179
#endif
180180

181181
STDEXEC_NAMESPACE_STD_BEGIN
182-
namespace execution::system_context_replaceability
183-
{}
182+
namespace execution
183+
{
184+
namespace parallel_scheduler_replacement
185+
{}
186+
187+
namespace [[deprecated("Use the std::execution::parallel_scheduler_replacement namespace "
188+
"instead.")]] system_context_replaceability
189+
{
190+
using namespace parallel_scheduler_replacement;
191+
} // namespace system_context_replaceability
192+
} // namespace execution
193+
184194
namespace this_thread
185195
{}
186196
STDEXEC_NAMESPACE_STD_END

0 commit comments

Comments
 (0)