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

Method ExecServerThread

library/cpp/netliba/v12/udp_http.cpp:1083–1117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1081 }
1082 }
1083 static void* ExecServerThread(void* param) {
1084 BindToSocket(0);
1085 SetHighestThreadPriority();
1086 TUdpHttp* pThis = (TUdpHttp*)param;
1087 pThis->Host = CreateUdpHost(pThis->Socket);
1088 pThis->HasStarted.Signal();
1089 if (!pThis->Host) {
1090 pThis->Socket.Drop();
1091 return nullptr;
1092 }
1093 NHPTimer::GetTime(&pThis->PingsSendT);
1094 NHPTimer::GetTime(&pThis->ConnectionsCacheT);
1095 while (AtomicAdd(pThis->KeepRunning, 0) && !AtomicAdd(PanicAttack, 0)) {
1096 if (HeartbeatTimeout.load(std::memory_order_acquire) > 0) {
1097 NHPTimer::STime chk = LastHeartbeat.load(std::memory_order_acquire);
1098 double passed = NHPTimer::GetTimePassed(&chk);
1099 if (passed > HeartbeatTimeout.load(std::memory_order_acquire)) {
1100 StopAllNetLibaThreads();
1101 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));
1102 fflush(stderr);
1103#ifndef _win_
1104 killpg(0, SIGKILL);
1105#endif
1106 abort();
1107 break;
1108 }
1109 }
1110 pThis->Step();
1111 pThis->Wait();
1112 }
1113 if (!AtomicAdd(pThis->AbortTransactions, 0) && !AtomicAdd(PanicAttack, 0))
1114 pThis->FinishOutstandingTransactions();
1115 pThis->Host = nullptr;
1116 return nullptr;
1117 }
1118 ~TUdpHttp() override {
1119 if (std::uncaught_exceptions()) {
1120 TUdpHttp::StopNoWait();

Callers

nothing calls this directly

Calls 14

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

Tested by

no test coverage detected