\"\" \"\" \"\"
Go backward to Wait(): Returning the Bag Results
Go up to Selectors
RISC-Linz logo

Size(): Size of a Thread Bag

size = Size(b)
      int size
      ThreadBag<R> b

Specification: Returns the number of threads in the bag after the bag has been closed. This includes also all threads whose number has been declared in the close statement but that have actually not yet entered the bag.

Constraints: It is illegal to apply this operation if b is unbound.

Complexity: O(1).

Implementation: If the bag is not yet closed, the current thread is blocked until another thread closes the bag. If the bag will never be closed, the current thread will be permanently blocked.


Author: Wolfgang Schreiner
Last Modification: April 12, 1997