Size()
: Size of a Thread Bag
Wait()
: Returning the Bag Results=
Wait
(b, i) =
Wait
(b, i, &
d) Specification: Returns the result r with index i from bag b. In the second form, d is set to 1 if an object with such an index exists and 0 else. The first result has index 0.
The index ordering of thread results is unspecified apart from the following constraint (n is the number of threads in b):
If Wait
(b, i) blocks forever (because the corresponding
thread t_i never terminates), then also each thread t_j with i<j<n will
never terminate provided that
t_j has been started with start
.
Constraints: It is illegal to apply Wait
to an unbound handle
b. It is illegal to apply Wait
to some i less than zero. In
the first form, it is illegal to apply Wait
to some i larger than
Size
(b)-1.
Complexity: