Title:

sendTask() - places a task on the end of a thread's task queue for evaluation in the future.

Usage:

sendTask(expression, thread, wait=F)

Arguments:

expression:
an expression or list of expressions that are to be appended to the task queue of the thread specified in thread.
thread:
the thread object which is to evaluate the expressions supplied in
wait:
a logical value indicating whether the requesting thread should wait to return from this call until the requested thread has evaluated the task.

Side Effect:

This function arranges for the list of expressions passed via expression to be appended to the task queue for the given thread. If thread is missing, the tasks are appended to the current thread, self(). I don't think people would want to do this, but that is their problem. They might want to set a whole load of tasks running and have them in the background and take very little time to queue them in the calling thread. Dubious, but any other default is silly. Perhaps just signal an error!

Return Value:

The return value differs depending on the value of wait.
wait == F
The position/index in the queue of this expression - this is 1 based counting. If the expression was not added to the relevant queue, the value F is returned. This could be either because the queue is deemed to be full (unlikely as we haven't put a limit on its size yet!) or because access has been denied to this thread by the other thread. See the threadAttributes class.
wait == T
the return value is the result of evaluating expression.

See Also:

thread(),
self()

Examples:

        sendTask(list(Quote(sum(x)),Quote(f <- lm(x,y)), threadB)

Key Words:


Last modified: Tue Feb 25 09:01:29 1997