Boost logo

Boost :

Subject: Re: [boost] [gsoc-2013] Boost.Thread/ThreadPool project
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-04-21 09:47:26

Le 21/04/13 14:12, Dan Lincan a écrit :
> Hello,
> I would like to know if I'm going in the right direction.
> Threadpool ideas:
> 1. simple
> * fixed number of threads ( possibly bound to number of cpus/cores )
> * add_task
I don't like add_task. Maybe better use async, launch or submit.
What would be the result?
> 2. simple + scheduling
> * variable number of threads
> - specify boundaries(min/max)
> - a lightweight algorithm in place to determine when to add /
> remove new threads withing boundaries to increase the throughoutput
What would be the advantage of having a dynamic number of threads?
What do you mean by scheduler?
> * add_task
> * add_task_after(time_point)
> - the task will be scheduled only after time_point has passed
> - 2 possibilities ( relative time, absolute time )
It would be better to distinguish between launch after a duration and
launch at a time point.
Why these time related functions are not on the simple thread pool?
> 3. complex = simple + scheduling + work-stealing
> * variable number of threads
> * add_task
> * add_task_after(time_point)
> * work-stealing
> All of them will use the chrono library for time mesurement.
> For the proposal I have to point out where changes should be made in
> the current implementation at [1] or I need to provide a prototype of
> a new interface?
I would like to see a new interface on the proposal. [1] could be used
to get insight on the domain.
There is a on going c++1y proposal [2] that could help you. I would
prefer however that the interface don't use dynamic polymorphism
(inheritance) but a static one (concept). We can always adapt a dynamic
polymorphic interface on top of the static one. The book CCiA [2]
contains a lot of useful information related to the project. A mandatory
book to read for the project. In particular there are implementation of
static polymorphic thread-pools including work-stealing.

> [1]
[2] Executors and schedulers, revision 1
[3] C++ Concurrency in Action by A. Williams.

Boost list run by bdawes at, gregod at, cpdaniel at, john at