Skip to content

Commit 9f68109

Browse files
authored
Merge pull request #1579 from ericniebler/write-env-and-unstoppable
add `write_env` and `unstoppable` sender adaptors to `stdexec::`
2 parents de92b54 + 894f29a commit 9f68109

32 files changed

Lines changed: 265 additions & 241 deletions

examples/benchmark/asio_thread_pool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct RunThread {
4545
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
4646
std::size_t scheds = end - start;
4747
std::atomic<std::size_t> counter{scheds};
48-
auto env = exec::make_env(stdexec::prop{stdexec::get_allocator, alloc});
48+
auto env = stdexec::prop{stdexec::get_allocator, alloc};
4949
while (scheds) {
5050
stdexec::start_detached(
5151
stdexec::schedule(scheduler) | stdexec::then([&] {

examples/benchmark/common.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
#include <exec/env.hpp>
1817
#include <exec/__detail/__numa.hpp>
1918
#include <exec/static_thread_pool.hpp>
2019

examples/benchmark/static_thread_pool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct RunThread {
4747
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
4848
std::size_t scheds = end - start;
4949
std::atomic<std::size_t> counter{scheds};
50-
auto env = exec::make_env(stdexec::prop{stdexec::get_allocator, alloc});
50+
auto env = stdexec::prop{stdexec::get_allocator, alloc};
5151
while (scheds) {
5252
stdexec::start_detached(
5353
stdexec::schedule(scheduler) | stdexec::then([&] {

examples/benchmark/static_thread_pool_bulk_enqueue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ struct RunThread {
4242
# ifndef STDEXEC_NO_MONOTONIC_BUFFER_RESOURCE
4343
pmr::monotonic_buffer_resource rsrc{buffer.data(), buffer.size()};
4444
pmr::polymorphic_allocator<char> alloc{&rsrc};
45-
auto env = exec::make_env(stdexec::prop{stdexec::get_allocator, alloc});
45+
auto env = stdexec::prop{stdexec::get_allocator, alloc};
4646
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
4747
auto iterate = exec::schedule_all(pool, std::views::iota(start, end))
48-
| exec::ignore_all_values() | exec::write_env(env);
48+
| exec::ignore_all_values() | stdexec::write_env(env);
4949
# else
5050
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
5151
auto iterate = exec::schedule_all(pool, std::views::iota(start, end))

examples/benchmark/static_thread_pool_bulk_enqueue_nested.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ struct RunThread {
4343
# ifndef STDEXEC_NO_MONOTONIC_BUFFER_RESOURCE
4444
pmr::monotonic_buffer_resource rsrc{buffer.data(), buffer.size()};
4545
pmr::polymorphic_allocator<char> alloc{&rsrc};
46-
auto env = exec::make_env(stdexec::prop{stdexec::get_allocator, alloc});
46+
auto env = stdexec::prop{stdexec::get_allocator, alloc};
4747
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
4848
auto iterate = exec::iterate(std::views::iota(start, end)) | exec::ignore_all_values()
49-
| exec::write_env(env);
49+
| stdexec::write_env(env);
5050
# else
5151
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
5252
auto iterate = exec::iterate(std::views::iota(start, end)) | exec::ignore_all_values();

examples/benchmark/static_thread_pool_nested.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct RunThread {
4545
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
4646
std::size_t scheds = end - start;
4747
std::atomic<std::size_t> counter{scheds};
48-
auto env = exec::make_env(stdexec::prop{stdexec::get_allocator, alloc});
48+
auto env = stdexec::prop{stdexec::get_allocator, alloc};
4949
stdexec::sync_wait(stdexec::schedule(scheduler) | stdexec::then([&] {
5050
auto nested_scheduler = pool.get_scheduler();
5151
while (scheds) {

examples/benchmark/static_thread_pool_nested_old.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct RunThread {
4545
auto [start, end] = exec_old::even_share(total_scheds, tid, pool.available_parallelism());
4646
std::size_t scheds = end - start;
4747
std::atomic<std::size_t> counter{scheds};
48-
auto env = exec::make_env(stdexec::prop{stdexec::get_allocator, alloc});
48+
auto env = stdexec::prop{stdexec::get_allocator, alloc};
4949
stdexec::sync_wait(stdexec::schedule(scheduler) | stdexec::then([&] {
5050
while (scheds) {
5151
stdexec::start_detached(

examples/benchmark/static_thread_pool_old.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct RunThread {
4747
auto [start, end] = exec_old::even_share(total_scheds, tid, pool.available_parallelism());
4848
std::size_t scheds = end - start;
4949
std::atomic<std::size_t> counter{scheds};
50-
auto env = exec::make_env(stdexec::prop{stdexec::get_allocator, alloc});
50+
auto env = stdexec::prop{stdexec::get_allocator, alloc};
5151
while (scheds) {
5252
stdexec::start_detached(
5353
stdexec::schedule(scheduler) | stdexec::then([&] {

examples/benchmark/taskflow_thread_pool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct RunThread {
4545
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
4646
std::size_t scheds = end - start;
4747
std::atomic<std::size_t> counter{scheds};
48-
auto env = exec::make_env(stdexec::prop{stdexec::get_allocator, alloc});
48+
auto env = stdexec::prop{stdexec::get_allocator, alloc};
4949
while (scheds) {
5050
stdexec::start_detached(
5151
stdexec::schedule(scheduler) | stdexec::then([&] {

examples/benchmark/tbb_thread_pool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct RunThread {
4545
auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism());
4646
std::size_t scheds = end - start;
4747
std::atomic<std::size_t> counter{scheds};
48-
auto env = exec::make_env(stdexec::prop{stdexec::get_allocator, alloc});
48+
auto env = stdexec::prop{stdexec::get_allocator, alloc};
4949
while (scheds) {
5050
stdexec::start_detached(
5151
stdexec::schedule(scheduler) | stdexec::then([&] {

0 commit comments

Comments
 (0)