Welcome

SweSTHLM1

StockholmCpp

event flyer0x3D

Today’s sponsor

 

netinsight

C++ news

 

C++ news

 

C++26 is done

⇒ trip report https://herbsutter.com/

TK611/AG09

 

TK611/AG09

 

Existing members and paper contributors
  • Bengt Gustafsson

  • Jonas Persson

TK611/AG09

 

Existing members and paper contributors
  • Bengt Gustafsson

  • Jonas Persson

New member and paper contributors
  • Ted Lyngmo

    • P3832 Timed lock algorithms for multiple lockables

    • P3833 std::multi_lock

TK611/AG09

 

Want to participate on WG21 work?
That is possible!

Contact me

SwedenCpp News

SwedenCpp News

 

StockholmCpp Planning 2026
  • 28 Mai

  • long summer break

  • 27 August

SwedenCpp News

Buy Me a Coffee
coffee2

https://buymeacoffee.com/swedencpp
test flight for support via swedencpp.se

SwedenCpp News

 

X and Bsky get a daily reminder to visit us

Call for Papers!

A community from the community for the community

needyou

Submit your ideas and suggestions

Call for Papers!

You know how it works

whowants

Quiz time

JetBrainsLicense

Quiz time

 

  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

Unsynchronized work

Quiz time

 

  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 done

Wanted: synchronize

Quiz time

 

  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 done

How to synchronize ?

Quiz time

 

  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 done

std::latch && std::barrier since C++20

Today’s program

πŸ‡«πŸ‡·πŸ‡ΈπŸ‡ͺπŸ‡«πŸ‡· πŸ‡«πŸ‡·πŸ‡ΈπŸ‡ͺπŸ‡«πŸ‡·

  • Florent: Introduction to the Bazel build system

  • 🍹 πŸ• Mingle πŸ• 🍻

  • Mathieu: The Performance Mindset

VΓ€l mΓΆtt!

πŸ‡«πŸ‡·πŸ‡ΈπŸ‡ͺπŸ‡«πŸ‡· πŸ‡«πŸ‡·πŸ‡ΈπŸ‡ͺπŸ‡«πŸ‡·