#include <synchro.h>
Inheritance diagram for rpa::thread_stack< Ftor, Thr >::node:
Public Types | |
typedef Ftor::result_type | result_type |
Public Member Functions | |
node (Ftor &aFtor, Thr &aThr) | |
Private Attributes | |
node * | _next |
Friends | |
class | iterator |
class | thread_stack |
typedef Ftor::result_type rpa::thread_stack< Ftor, Thr >::node::result_type |
Reimplemented from rpa::future< Ftor, Thr >.
rpa::thread_stack< Ftor, Thr >::node::node | ( | Ftor & | aFtor, | |
Thr & | aThr | |||
) | [inline] |
The constructor launches the sub-thread. We MUST cross a memory barrier before launching the sub-threads : Because of '_refFtor' and '_refThr'.
friend class iterator [friend] |
friend class thread_stack [friend] |
node* rpa::thread_stack< Ftor, Thr >::node::_next [private] |
Pointer to the next 'node' object, of the same algorithm execution, by another thread. These 'node' objects are organised into a chained list, created by recursive calls, with one element by sub-thread. All 'node' objects are stored on the stack. Once they are all created, the main thread waits for sub-threads termination, and does reduction in original and natural evaluation order. It is done by 'reduction()' called at the deepest recursive level : This ensures that all temporary 'node' objects created on the stack are still available.