A thread bag of type ThreadBag<T> holds a
collection of threads with result type T. The order in which the bag
delivers the thread results is unspecified apart from the constraint that the
bag delivers the results of all terminating threads first (i.e. a thread
waiting for a bag result may be permanently blocked only after it has received
the results of all terminating threads). This constraint is implemented by
returning those results first that are delivered first (non-determinism). This
may improve the efficiency of parallel programs and is in most cases the
actual reason why thread bags are applied.
Author: Wolfgang Schreiner Last Modification: April 12, 1997