Go backward to open() : Open a Bag (Binding Form)Go up to Constructors |
ThreadBag
n: Adding a Threadcreate
(b, f, a, ...,
a) start
(b, f, a, ...,
a) Specification: Adds to b a new thread computing f(, ..., ).
Restrictions: The number of arguments ranges from to an implementation-dependent constant (currently ). This range may be extended by defining the corresponding template class.
Note: Only the third form of thread creation by start
guarantees the "true" semantics of thread bags, namely that in the ordering
of delivered results (Returning the
Bag Results) non-terminating threads only appear after all
terminating threads. However, if all threads are guaranteed to terminate, the
second form is equivalent and in general much more efficient.
Implementation: Normally, the first form is equivalent to the second
form. However, if the preprocessor constant
RT_TBAG_NOTLAZY
is defined
before including the header file
rt++.h, the first form is equivalent to the third form.