One of the goals of UNIX was to enable a number of users to use the system simultaneously (multiuser capability). Because several users might also want to use several different programs simultaneously, mechanisms must be available to allow these programs to run simultaneously (multitasking capability).
The implementation of a multiuser and multitasking system appears to be simultaneous in a single processor system, but this is only possible in a multiprocessor system.
Even in a single-processor system, advantages can be gained through multitasking because waiting times for input or output from processes can be used for other processes. UNIX implements preemptive multitasking--each process is allowed a maximum time with which it can work. When this time has expired, the operating system takes processor time away from the process and assigns it to another process waiting to run. Other operating systems (such as versions older than the MAC OS version X) do not intervene in this process cycle. Instead, control over the processor must be released by the running process before another process can run.
This can lead to one process hijacking the processor, leaving other processes without processing time and blocking the system. The operating system coordinates access to the resources available in the system (hard drives, tapes, interfaces). If there is competition among processes, e.g., for access to a tape device, only one process can be granted access. The others must be rejected.
This coordination task is very complex and no operating system is able to implement an ideal solution. The classic problem involves a situation in which two or more processes exclusively need the same resources,
Multithreading is an extension of multitasking, and helps solve this problem. In multithreading, a number of parts independent from one another (threads) can be produced within a process. Multithreading increases the level of parallel processes with each thread needing to be administered, which makes the use of a multiprocessor system more valuable.
A clear distinction should be made here between programs and processes: as a rule, a program exists only once in the system, but there can be several processes that perform the same program.
If a number of users are active, both programs and processes can be used independently of one another (such as a program used to display directories).