const int N = 4;
std::vector<std::jthread> threads;
for (int i = 0; i < N; ++i)
threads.emplace_back([] {
std::println("work");
std::println("done");
});
// work done work done work done work done


Bengt Gustafsson
Jonas Persson
Want to participate on WG21 work?
That is possible!
Contact me
28 Mai
long summer break
27 August
X and Bsky get a daily reminder to visit us
A community from the community for the community

Submit your ideas and suggestions
You know how it works


const int N = 4;
std::vector<std::jthread> threads;
for (int i = 0; i < N; ++i)
threads.emplace_back([] {
std::println("work");
std::println("done");
});
// work done work done work done work doneUnsynchronized work
const int N = 4;
std::vector<std::jthread> threads;
for (int i = 0; i < N; ++i)
threads.emplace_back([] {
std::println("work");
std::println("done");
});
// work work work work done done done doneWanted: synchronize
const int N = 4;
std::vector<std::jthread> threads;
std::_____ ready{N};
for (int i = 0; i < N; ++i)
threads.emplace_back([&ready] {
std::println("work");
ready.arrive_and_wait();
std::println("done");
});
// work work work work done done done doneHow to synchronize ?
const int N = 4;
std::vector<std::jthread> threads;
std::latch ready{N};
for (int i = 0; i < N; ++i)
threads.emplace_back([&ready] {
std::println("work");
ready.arrive_and_wait();
std::println("done");
});
// work work work work done done done donestd::latch && std::barrier since C++20
π«π·πΈπͺπ«π· π«π·πΈπͺπ«π·
Florent: Introduction to the Bazel build system
πΉ π Mingle π π»
Mathieu: The Performance Mindset
VΓ€l mΓΆtt!
π«π·πΈπͺπ«π· π«π·πΈπͺπ«π·