Title:

setThreadAttributes - set threadAttributes for one or more thread objects to a common value after these threads have been created.

Usage:

setThreadAttributes(..., attributes, priority, detach, stackSize, access, input, output, error, wait, mask )

Arguments:

...:
a thread or threadGroup object or vector and lists containing objects these classes. This is the standard form for an arbitrary collection of thread objects passed to a function. If no values are passed to this argument (length of list(...) is 0), self() is assumed and the calling threads attributes are modified appropriately.
attributes:
Rather than specifying the individual components of the threadAttributes object, an existing object can be passed to this function. Values in this object are overridden by specifying a value for the corresponding argument to this function of the same name as the slot in the threadAttributes object. See attributes for description of this class of object.
priority:
See priority for a description of this parameter.
detach:
See detach for a description of this parameter. This can be modified after creation of the thread.
stackSize:
can't be reset after creation! See stackSize,
access:
See access for a description of this parameter.
input:
See input for a description of this parameter.
output:
See output for a description of this parameter.
error:
See error for a description of this parameter.
wait:
if this is T, the call doesn't return until each thread whose attributes can be modified by this calling thread has notified the Evaluator Manager that it has assumed these changes. If the value is F, the requests are made asynchronously and the call returns immediately having made the requests. No receipt of request is returned.
mask:
ARGUMENT USED INTERNALLY IN "Recusrive Calls". Don't touch!

Return Value:

if wait is T, the value returned by each thread on evaluating the request is returned. For a given thread, if successful, the return value is T and so the return value for the call to mulitple threads

Side Effect:

A request is sent to each thread, if possible given the current access permissions, via sendTask() to set the threadAttributes for that thread.
           sendTask(substitute(setThreadAttributes(self(),attributes=attrs),list(attrs = attributes)),
                       thread = target)
        
Each target thread sends notification to the Evaluator manager and, if wait is T, a message back to the thread with the value of the original request evaluated in that target thread.

See Also:

thread
threadAttributes

Examples:

      # change the output of a group of threads
      # can also be done by sending a request to each thread to evaluate a
      # call sink() with a common connection
     setThreadAttributes(tA,tB, output=file("common_output"),priority=20,wait=T)
      # now evaluate expressions in each of these tasks
      sendTask(Quote(print(lm(x[[1]],y[[1]]))),tA)
      sendTask(Quote(print(lm(x[[2]],y[[2]]))),tB)     
       # lower the priority  of the child threads of this calling thread
      setThreadAttributes(children(),priority=1)

Key Words:

User Level Thread Interface

Last modified: Mon Feb 10 16:35:45 1997