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

Method ThreadFunc

library/cpp/netliba/v6/ib_mem.cpp:119–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117 }
118
119 void* TIBMemPool::ThreadFunc(void* param) {
120 BindToSocket(0);
121 SetHighestThreadPriority();
122 TIBMemPool* pThis = (TIBMemPool*)param;
123 pThis->HasStarted.Signal();
124
125 while (pThis->KeepRunning) {
126 TJobItem* work = nullptr;
127 if (!pThis->Requests.Dequeue(&work)) {
128 pThis->HasWork.Reset();
129 if (!pThis->Requests.Dequeue(&work)) {
130 pThis->HasWork.Wait();
131 }
132 }
133 if (work) {
134 //printf("mem copy got work\n");
135 int sz = work->Data->GetSize();
136 work->Block = pThis->Alloc(sz);
137 TBlockChainIterator bc(work->Data->GetChain());
138 bc.Read(work->Block->GetData(), sz);
139 TIntrusivePtr<TCopyResultStorage> dst = work->ResultStorage;
140 work->ResultStorage = nullptr;
141 dst->Results.Enqueue(work);
142 //printf("mem copy completed\n");
143 }
144 }
145 return nullptr;
146 }
147
148 //////////////////////////////////////////////////////////////////////////
149 static TMutex IBMemMutex;

Callers

nothing calls this directly

Calls 11

SetHighestThreadPriorityFunction · 0.85
BindToSocketFunction · 0.70
SignalMethod · 0.45
DequeueMethod · 0.45
ResetMethod · 0.45
WaitMethod · 0.45
GetSizeMethod · 0.45
AllocMethod · 0.45
ReadMethod · 0.45
GetDataMethod · 0.45
EnqueueMethod · 0.45

Tested by

no test coverage detected