47 template <
typename FUNCTION>
53 m_tasks.push_back( aPool.submit_task( std::forward<FUNCTION>( aFunction ) ) );
71template <
typename FUNCTION>
82 const size_t workers = std::min<size_t>( aCount, aPool.get_thread_count() );
85 for(
size_t worker = 0; worker < workers; ++worker )
87 tasks.
Submit( aPool, [&, worker]
89 for(
size_t ordinal = worker; ordinal < aCount; ordinal += workers )
std::vector< std::future< void > > m_tasks
void Submit(thread_pool &aPool, FUNCTION &&aFunction)
TASK_GROUP(const TASK_GROUP &)=delete
TASK_GROUP(size_t aCount)
TASK_GROUP & operator=(const TASK_GROUP &)=delete
Value keys and the key session of the schematic connectivity engine.
void ParallelFor(size_t aCount, FUNCTION &&aFunction, thread_pool &aPool=GetKiCadThreadPool())
Independent ordinal writes only; preparation and cache commits stay on the caller thread.
thread_pool & GetKiCadThreadPool()
Get a reference to the current thread pool.
BS::priority_thread_pool thread_pool