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

Method ExecServerThread

library/cpp/netliba/v6/udp_http.cpp:967–1000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

965 }
966 }
967 static void* ExecServerThread(void* param) {
968 BindToSocket(0);
969 SetHighestThreadPriority();
970 TUdpHttp* pThis = (TUdpHttp*)param;
971 pThis->Host = CreateUdpHost(pThis->Socket);
972 pThis->HasStarted.Signal();
973 if (!pThis->Host) {
974 pThis->Socket.Drop();
975 return nullptr;
976 }
977 NHPTimer::GetTime(&pThis->PingsSendT);
978 while (pThis->KeepRunning && !PanicAttack) {
979 if (HeartbeatTimeout.load(std::memory_order_acquire) > 0) {
980 NHPTimer::STime chk = LastHeartbeat.load(std::memory_order_acquire);
981 double passed = NHPTimer::GetTimePassed(&chk);
982 if (passed > HeartbeatTimeout.load(std::memory_order_acquire)) {
983 StopAllNetLibaThreads();
984 fprintf(stderr, "%s\tTUdpHttp\tWaiting for %0.2f, time limit %0.2f, commit a suicide!11\n", Now().ToStringUpToSeconds().c_str(), passed, HeartbeatTimeout.load(std::memory_order_acquire));
985 fflush(stderr);
986#ifndef _win_
987 killpg(0, SIGKILL);
988#endif
989 abort();
990 break;
991 }
992 }
993 pThis->Step();
994 pThis->Wait();
995 }
996 if (!pThis->AbortTransactions && !PanicAttack)
997 pThis->FinishOutstandingTransactions();
998 pThis->Host = nullptr;
999 return nullptr;
1000 }
1001 ~TUdpHttp() override {
1002 if (myThread.Running()) {
1003 KeepRunning = false;

Callers

nothing calls this directly

Calls 13

SetHighestThreadPriorityFunction · 0.85
ToStringUpToSecondsMethod · 0.80
BindToSocketFunction · 0.70
CreateUdpHostFunction · 0.70
StopAllNetLibaThreadsFunction · 0.70
NowFunction · 0.50
SignalMethod · 0.45
DropMethod · 0.45
loadMethod · 0.45
c_strMethod · 0.45
StepMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected