MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / ThreadPool

Method ThreadPool

src/thread_pool.cc:127–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125
126
127 ThreadPool::ThreadPool(size_t num_threads, size_t maximum_queue_size, int core_offset)
128 : _queue(maximum_queue_size)
129 , _num_active_jobs(0)
130 {
131 _workers.reserve(num_threads);
132 for (size_t i = 0; i < num_threads; ++i)
133 _workers.emplace_back(std::make_unique<Worker>());
134
135 start_workers(core_offset);
136 }
137
138 ThreadPool::ThreadPool(std::vector<std::unique_ptr<Worker>> workers,
139 size_t maximum_queue_size,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected