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

Function readerThread

runtime/Perf.cc:809–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

807
808static uint64_t variable = 0;
809void readerThread(uint64_t *variableToRead,
810 volatile bool *run,
811 pthread_barrier_t *barrier,
812 int core=0)
813{
814 bindThreadToCpu(core);
815 pthread_barrier_wait(barrier);
816
817 uint64_t sum = 0;
818 while(*run) {
819 sum += variable;
820 NanoLogInternal::Fence::lfence();
821 }
822
823 discard(&sum);
824}
825
826double mm_stream_pi_contended()
827{

Callers

nothing calls this directly

Calls 2

bindThreadToCpuFunction · 0.85
discardFunction · 0.70

Tested by

no test coverage detected