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

Method Loop

library/cpp/neh/rpc.cpp:83–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 }
82
83 inline void Loop(size_t threads) {
84 Y_ENSURE(!HasLoop_ || *HasLoop_);
85 HasLoop_ = true;
86
87 TIntrusivePtr<TServices> self(this);
88 IRequesterRef rr = MultiRequester(ListenAddrs(), this);
89 TFunc func(this);
90
91 typedef TAutoPtr<IThreadFactory::IThread> IThreadRef;
92 TVector<IThreadRef> thrs;
93
94 for (size_t i = 1; i < threads; ++i) {
95 thrs.push_back(SystemThreadFactory()->Run(&func));
96 }
97
98 func.Execute();
99
100 for (size_t i = 0; i < thrs.size(); ++i) {
101 thrs[i]->Join();
102 }
103 RQ_->Clear();
104 }
105
106 inline void ForkLoop(size_t threads) {
107 Y_ENSURE(!HasLoop_ || *HasLoop_);

Callers 1

LoopMethod · 0.45

Calls 7

SystemThreadFactoryFunction · 0.85
push_backMethod · 0.45
RunMethod · 0.45
ExecuteMethod · 0.45
sizeMethod · 0.45
JoinMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected