MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / notify_all

Function notify_all

runtime/Perf.cc:858–869  ·  view source on GitHub ↗

Cost of notifying a condition variable

Source from the content-addressed store, hash-verified

856
857// Cost of notifying a condition variable
858double notify_all() {
859 int count = 1000000;
860 std::condition_variable cond;
861
862 uint64_t start = Cycles::rdtsc();
863 for (int i = 0; i < count; ++i) {
864 cond.notify_all();
865 }
866 uint64_t stop = Cycles::rdtsc();
867
868 return Cycles::toSeconds(stop - start)/count;
869}
870
871double notify_one() {
872 int count = 1000000;

Callers

nothing calls this directly

Calls 1

rdtscFunction · 0.85

Tested by

no test coverage detected