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

Method PrepareRead

library/cpp/threading/chunk_queue/queue.h:313–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311 }
312
313 TEntry* PrepareRead(size_t& index) {
314 TEntry* entry = nullptr;
315 ui64 tag = Max();
316
317 for (size_t i = 0; i < Concurrency; ++i) {
318 TEntry* e = Queues[i].PrepareRead();
319 if (e && e->Tag < tag) {
320 index = i;
321 entry = e;
322 tag = e->Tag;
323 }
324 }
325
326 if (entry) {
327 // need second pass to catch updates within already scanned range
328 size_t candidate = index;
329 for (size_t i = 0; i < candidate; ++i) {
330 TEntry* e = Queues[i].PrepareRead();
331 if (e && e->Tag < tag) {
332 index = i;
333 entry = e;
334 tag = e->Tag;
335 }
336 }
337 }
338
339 return entry;
340 }
341 };
342
343 ////////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 2

MaxFunction · 0.50
PrepareReadMethod · 0.45

Tested by

no test coverage detected