The information whether a function can be called in the Controller thread, the Processor thread, or in both threads, can be found on the Reference pages below the description of each function.
It looks like this:
Script Error - Wrong Thread
If you call a function in the wrong thread, the script module will output an error message.
The output message for the script error of the above example looks like this:
If this ever happens to you, please review your code and try to place the function call elsewhere in your script, for example. Alternatively, you could use runAsync.
Through runAsync you get access to the functions of the Controller thread also in the Processor thread. The execution of runAsync takes at least one audio block, or longer, depending on the function which was called. The callback which called runAsync is put on hold until the function has completed. Please be aware of this when using runAsync.
Functions of the Processor thread cannot be called in the Controller thread.