Process:
Filter:
Classes | Core > Kernel

Process : Object

Runtime environment for the virtual machine and interpreter.
Source: Kernel.sc
Subclasses: Main

Description

A Process is the runtime environment for the virtual machine and interpreter. It has a subclass named Main which is where you should override the methods of Process. There are two methods of interest. One is named startup and is called after the class library has been compiled. The other is named run and is called when the user chooses the Run menu command.

Class Methods

Process.tailCallOptimize

Process.tailCallOptimize = bool

Get or set tail call optimization. The default is on. Setting this to false can help with debugging by including intermediate levels in an error backtrace.

Inherited class methods

Undocumented class methods

Process.elapsedTime

Process.monotonicClockTime

Instance Methods

.nowExecutingPath

.nowExecutingPath = value

Usage: thisProcess.nowExecutingPath

Returns the full path to the file containing the code that is currently executing interactively in the interpreter. Usually this is the current document. If the code block executes another file on disk, using String: -load or String: -loadPaths, nowExecutingPath will be the location of the executed file.

nowExecutingPath is valid only for interactive code, i.e., code files with a .scd extension. It does not apply to class definitions (.sc). For that, use thisMethod.filenameSymbol or this.class.filenameSymbol.

This method is supported in the SuperCollider IDE, the macOS-only SuperCollider.app, and the scel (SuperCollider-Emacs-Lisp) environment. In other editor environments, it will return nil.

WARNING: nowExecutingPath has a corresponding setter method, nowExecutingPath_, for internal use only by the interpreter. Do not call the setter method!

.startup

called after the class library has been compiled. Override this in class Main to do whatever you want.

.run

called when the user chooses the Run menu command. Override this in class Main to do whatever you want.

.mainThread

The top-level Thread, i.e the parent of all other Threads. This instance of Thread always exists and is created with the Process when SuperCollider starts.

Discussion:

All SuperCollider code initially runs in the context of the main Thread:

This means that thisThread will always initially point to the main Thread. However, when some code starts a Routine, the Routine becomes the current Thread, with the main Thread as its parent.

Inherited instance methods

Undocumented instance methods

.archiveAsCompileString

.argv

.getCurrentSelection

.interpretCmdLine

.interpretPrintCmdLine

.interpretPrintSelectedText

.interpreter

.methodReferences

.methodTemplates

.openCodeFile

.openWinCodeFile

.prSchedulerQueue

.shallowCopy

.showHelp

.shutdown

.stop

.tick