Go backward to Wait(): Returning the Bag Results
Go up to Selectors

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.


Wolfgang.Schreiner@risc.uni-linz.ac.at
Id: main.tex,v 1.10 1996/04/04 11:45:47 schreine Exp

Prev Up