One of the most powerful features of IC is its multi-tasking facility. Processes can be created and destroyed dynamically during run-time.
Any C function can be spawned as a separate task. Multiple tasks running the same code, but with their own local variables, can be created.
Processes communicate through global variables: one process can set a global to some value, and another process can read the value of that global.
Each time a process runs, it executes for a certain number of ticks, defined in milliseconds. This value is determined for each process at the time it is created. The default number of ticks is five; therefore, a default process will run for 5 milliseconds until its ``turn'' ends and the next process is run. All processes are kept track of in a process table; each time through the table, each process runs once (for an amount of time equal to its number of ticks).
Each process has its own program stack. The stack is used to pass arguments for function calls, store local variables, and store return addresses from function calls. The size of this stack is defined at the time a process is created. The default size of a process stack is 256 bytes.
Processes that make extensive use of recursion or use large local arrays will probably require a stack size larger than the default. Each function call requires two stack bytes (for the return address) plus the number of argument bytes; if the function that is called creates local variables, then they also use up stack space. In addition, C expressions create intermediate values that are stored on the stack.
It is up to the programmer to determine if a particular process requires a stack size larger than the default. A process may also be created with a stack size smaller than the default, in order to save stack memory space, if it is known that the process will not require the full default amount.
When a process is created, it is assigned a unique process identification number or pid. This number can be used to kill a process.