In computer programming, a task is a basic unit of programming that an operating system controls. Depending on how the operating system defines a task in its design, this unit of programming may be an entire program or each successive invocation of a program. Since one program may make requests of other utility programs, the utility programs may also be considered tasks (or subtasks). All of today's widely-used operating systems support multitasking , which allows multiple tasks to run concurrently, taking turns using the resources of the computer.
In preemptive multitasking , each task may be assigned a priority depending on its relative importance, the amount of resources it is consuming, and other factors. The operating system then preempts (cuts short) a task having a lower priority value so that a higher priority task is given a turn. Windows 2000 , OS/390 , Linux , and Amiga are examples of operating systems that use preemptive multitasking. Cooperative multitasking is the ability for an operating system to manage multiple tasks such as application programs at the same time, but without the ability to necessarily preempt them.
It's easy to confuse the terms multithreading and multitasking . Multithreading is the management of multiple concurrent uses of the same program. Most operating systems and modern computer languages also support multithreading.
An operating system concept that refers to the combination of a program being executed and bookkeeping information used by the operating system. Whenever you execute a program, the operating system creates a new task for it. The task is like an envelope for the program: it identifies the program with a task number and attaches other bookkeeping information to it.
Many operating systems, including UNIX, OS/2, and Windows, are capable of running many tasks at the same time and are called multitasking operating systems.
In most operating systems, there is a one-to-one relationship between the task and the program, but some operating systems allow a program to be divided into multiple tasks. Such systems are called multithreading operating systems.
The terms task and process are often used interchangeably, although some operating systems make a distinction between the two.