boost :: threadpool :: pool vs.boost :: thread_group
Estoy tratando de entender los diferentes casos de uso. y la diferencia entre los 2 usos de hilo.Esta Es un gran tutorial que he leído que explicaboost::thread_group
.
y aquí hay un código que estoy usando:
boost::threadpool::pool s_ThreadPool(GetCoreCount());
CFilterTask task(pFilter, // filter to run
boost::bind(&CFilterManagerThread::OnCompleteTask, this, _1, _2) // OnComplete sync callback // _1 will be filter name // _2 will be error code
);
// schedule the new task - runs on the threadpool
s_ThreadPool.schedule(task);
este es el destructor
s_ThreadPool.wait(0);
¿Puede usted explicar por favor?