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

Method SendMessages

library/cpp/neh/tcp2.cpp:1389–1421  ·  view source on GitHub ↗

must be called only after success aquiring output

Source from the content-addressed store, hash-verified

1387
1388 //must be called only after success aquiring output
1389 void SendMessages(bool asioThread) {
1390 DBGOUT("TServer::SendMessages(enter)");
1391 try {
1392 do {
1393 NeedCheckOutputQueue_.store(false);
1394 TAutoPtr<TOutputData> d;
1395 while (OutputData_.Dequeue(&d)) {
1396 d->MoveTo(OutputBuffers_);
1397 if (!OutputBuffers_.HasFreeSpace()) {
1398 if (!FlushOutputBuffers(asioThread)) {
1399 return;
1400 }
1401 }
1402 }
1403
1404 if (OutputBuffers_.HasData()) {
1405 if (!FlushOutputBuffers(asioThread)) {
1406 return;
1407 }
1408 }
1409
1410 OutputLock_.Release();
1411
1412 if (!NeedCheckOutputQueue_.load()) {
1413 DBGOUT("Server::SendMessages(exit2): " << (int)!OutputLock_.IsLocked());
1414 return;
1415 }
1416 } while (OutputLock_.TryAcquire());
1417 DBGOUT("Server::SendMessages(exit1)");
1418 } catch (...) {
1419 OnError();
1420 }
1421 }
1422
1423 bool FlushOutputBuffers(bool asioThread) {
1424 DBGOUT("FlushOutputBuffers: cnt=" << OutputBuffers_.GetIOvec()->Count() << " c=" << (size_t)this);

Callers

nothing calls this directly

Calls 9

HasFreeSpaceMethod · 0.80
HasDataMethod · 0.80
storeMethod · 0.45
DequeueMethod · 0.45
MoveToMethod · 0.45
ReleaseMethod · 0.45
loadMethod · 0.45
IsLockedMethod · 0.45
TryAcquireMethod · 0.45

Tested by

no test coverage detected