MCPcopy Create free account
hub / github.com/catboost/catboost / Worker

Method Worker

util/thread/lfstack_ut.cpp:249–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247 }
248
249 void Worker() {
250 StartLatch.CountDown();
251 StartLatch.Await();
252
253 TVector<typename TTest::ValueType> unused;
254 for (size_t i = 0; i < OperationsPerThread; ++i) {
255 switch (GetCycleCount() % 4) {
256 case 0: {
257 TTest::Enqueue(Stack, i);
258 break;
259 }
260 case 1: {
261 TTest::Dequeue(Stack);
262 break;
263 }
264 case 2: {
265 TTest::EnqueueAll(Stack);
266 break;
267 }
268 case 3: {
269 TTest::DequeueAll(Stack);
270 break;
271 }
272 }
273 }
274 }
275
276 void Run() {
277 TDeque<NThreading::TLegacyFuture<>> futures;

Callers

nothing calls this directly

Calls 5

GetCycleCountFunction · 0.85
EnqueueFunction · 0.50
DequeueFunction · 0.50
CountDownMethod · 0.45
AwaitMethod · 0.45

Tested by

no test coverage detected