Title:

threadGroup - a container for a collection of threads. Operations can be easily applied to all threads in a group, such as cancel, start, etc

Slots:

elements:
list of threads contained in this threadGroup object
name:
the character string that is used to identify this threadGroup in internal tables and on the different databases. This is to be considered inaccessible, or private, and is to be used internally in implementing this class and its methods.

Constructors:

threadGroup()

See Also:

thread
setThreadsAttributes()
elements()
addElements()

Examples:

     k = 10
     n = 100
     x = matrix(rnorm(n*k),n,k)
     group = threadGroup("fit.group")
     lock = threadLock("number of fit threads",num.threads = k, attach=2)
     
     for(i in 1:k) {
       thread(substitute(
                         fit[i] = lm(x,y), list(i = i)), data = list(x=x[,-i],y=x[,-i],
                         getLock(3);  
                         num.threads = num.threads - 1;
                         yieldLock(3);
              group=group)
     }

      # stop when the first thread finishes
     getLock(lock, condition = substitute(num.threads < k,list(k=k))
     cancel(group)

Key Words:


Last modified: Wed Feb 12 10:14:30 1997