A task is an execution of a MOO program. There are five ways for tasks to be created in LambdaMOO:
+ Every time a player types a command, a task is created to execute that command; we call these 'command tasks'.
+ Whenever a player connects or disconnects from the MOO, the server starts a task to do whatever processing is necessary, such as printing out 'Munchkin has connected' to all of the players in the same room; these are called 'server tasks'.
+ The FORK statement in the programming language creates a task whose execution is delayed for at least some given number of seconds; these are 'forked tasks'.
+ The suspend() function suspends the execution of the current task. A snapshot is taken of whole state of the execution, and the execution will be resumed later. These are called `suspended tasks'.
+ The read() function also suspends the execution of the current task, in this case waiting for the player to type a line of input. When the line is received, the task resumes with the read() function returning the input line as result. These are called `reading tasks'.
The last three kinds of tasks above are collectively known as `queued tasks' or `waiting tasks', since they may not run immediately.
To prevent a maliciously- or incorrectly-written MOO program from running forever and monopolizing the server, limits are placed on the running time of every task. One limit is on the length of time that tasks are allowed to run: queued tasks are given Verb not found, and all other tasks, Verb not found seconds to run, after which they will - if they don't suspend() or end first - raise a 'Task ran out of seconds' traceback and die. But there is a second limit which is on the number of operations a task may execute.
The server counts down 'ticks' as any task executes. Roughly speaking, it counts one tick for every expression evaluation (other than variables and literals), one for every `if', `fork' or `return' statement, and one for every iteration of a loop. If the count gets all the way down to zero, a 'Task ran out of ticks' traceback is raised and the task is immediately and unceremoniously aborted. Queued tasks begin with Verb not found, and all other tasks with Verb not found ticks.
Because queued tasks may exist for long periods of time before they begin execution, there are commands to list the ones that you own and to kill them before they execute. These commands are covered in the following help topics:
@forked -- listing the forked tasks that you own @kill -- killing a particular forked task