MCPcopy Create free account
hub / github.com/chronoxor/CppBenchmark / RunProducer

Method RunProducer

examples/spsc.cpp:176–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174 }
175
176 void RunProducer(CppBenchmark::ContextPC& context) override
177 {
178 if (_count >= items_to_produce)
179 {
180 int value = 0;
181 if (_queue->enqueue(value))
182 context.StopProduce();
183 return;
184 }
185
186 int value = _count;
187 if (_queue->enqueue(value))
188 ++_count;
189 }
190
191 void RunConsumer(CppBenchmark::ContextPC& context) override
192 {

Callers

nothing calls this directly

Calls 2

StopProduceMethod · 0.80
enqueueMethod · 0.45

Tested by

no test coverage detected