open()
: Open a Bag (Binding Form)ThreadBag
n: Adding a Threadcreate
(b, f, a_1, ...,
a_n) start
(b, f, a_1, ...,
a_n) Specification: Adds to b a new thread computing f(a_1, ..., a_n).
Restrictions: The number of arguments n ranges from 0 to an implementation-dependent constant (currently 4). 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.