ArticleslgStudy

computer science

Task (computing)

Task (computing) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Task (computing) rather than just read about it. In short: In computing, a task is a unit of execution or a unit of work. The term is ambiguous; precise alternative terms include process, light-weight process, thread (for execution), step, request, or query (for work).

Task (computing) — main illustration
Task (computing) — illustration

Key takeaways

  • Task (computing) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Task (computing) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Task (computing) from memory before moving on to harder problems.

Reference excerpt

In computing, a task is a unit of execution or a unit of work. The term is ambiguous; precise alternative terms include process, light-weight process, thread (for execution), step, request, or query (for work). In the adjacent diagram, there are queues of incoming work to do and outgoing completed work, and a thread pool of threads to perform this work. Either the work units themselves or the threads that perform the work can be referred to as "tasks", and these can be referred to respectively as requests/responses/threads, incoming tasks/completed tasks/threads (as illustrated), or requests/responses/tasks.

Terminology In the sense of "unit of execution", in some operating systems, a task is synonymous with a process, and in others with a thread. In non-interactive execution (batch processing), a task is a unit of execution within a job, with the task itself typically a process. The term "multitasking" primarily refers to the processing sense – multiple tasks executing at the same time – but has nuances of the work sense of multiple tasks being performed at the same time. In the sense of "unit of work", in a job (meaning "one-off piece of work") a task can correspond to a single step (the step itself, not the execution thereof), while in batch processing individual tasks can correspond to a single step of processing a single item in a batch, or to a single step of processing all items in the batch. In online systems, tasks most commonly correspond to a single request (in request–response architectures) or a query (in information retrieval), either a single stage of handling, or the whole system-wide handling.

Examples In the Java programming language, these two concepts (unit of work and unit of execution) are conflated when working directly with threads, but clearly distinguished in the Executors framework:

When you work directly with threads, a Thread serves as both a unit of work and the mechanism for executing it. In the executor framework, the unit of work and the execution mechanism are separate. The key abstraction is the unit of work, which is called a task.

IBM terminology IBM's use of the term has been influential, though underlining the ambiguity of the term, in IBM terminology, "task" has dozens of specific meanings, including:

A unit of work representing one of the steps in a process. A unit of work to be accomplished by a device or process. A process and the procedures that run the process. A set of actions designed to achieve a particular result. A task is performed on a set of targets on a specific schedule. A unit of computation. In a parallel job, two or more concurrent tasks work together through message passing and shared memory. Although it is common to allocate one task per physical or logical processor, the terms "task" and "processor" are not interchangeable. An activity that has business value, is initiated by a user, and is performed by software. In z/OS specifically, it is defined precisely as:

"In a multiprogramming or multiprocessing environment, one or more sequences of instructions treated by a control program as an element of work to be accomplished by a computer." The term task in OS/360 through z/OS is roughly equivalent to light-weight process; the tasks in a job step share an address space. However, in MVS/ESA through z/OS, a task or Service Request Block (SRB) may have access to other address spaces via its access list.

Linux kernel The term task is used in the Linux kernel (at least since v2.6.13, up to and including v4.8) to refer to a unit of execution, which may share various system resources with other tasks on the system. Depending on the level of sharing, the task may be regarded as a conventional thread or process. Tasks are brought into existence using the clone() system call, where a user can specify the desired level of resource sharing.

History The term task for a part of a job dates to multiprogramming in the early 1960s, as in this example from 1961:

The serial model has the ability to process tasks of one job in an independent manner similar to the functioning of the IBM 709. The term was popularized with the introduction of OS/360 (announced 1964), which featured Multiprogramming with a Fixed number of Tasks (MFT) and Multiprogramming with a Variable number of Tasks (MVT). In this case tasks were identified with light-weight processes, a job consisted of a number of tasks, and, later, tasks could have sub-tasks (in modern terminology, child processes). Today the term "task" is used very ambiguously. For example, the Windows Task Manager manages (running) processes, while Windows Task Scheduler schedules programs to execute in future, what is traditionally known as a job scheduler, and uses the .job extension. By contrast, the term "task queue" is commonly used in the sense of "units of work".

See also Task parallelism Task queue

References

Illustrations

Task (computing): A sample thread pool (green boxes) with task queues of waiting tasks (blue) and completed tasks (yellow), in the sense of task as "unit of work".
A sample thread pool (green boxes) with task queues of waiting tasks (blue) and completed tasks (yellow), in the sense of task as "unit of work".

Worked examples

Example 1 — a first encounter with Task (computing)

Start with the simplest possible case. Write down what Task (computing) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Task (computing) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Task (computing) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Task (computing)

In research
Task (computing) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Task (computing) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Task (computing) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computing terminology, so understanding it makes those chapters shorter.
In everyday life
Look for Task (computing) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Task (computing)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Task (computing) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Task (computing) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Task (computing) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Task (computing) in simple terms?

In computing, a task is a unit of execution or a unit of work. The term is ambiguous; precise alternative terms include process, light-weight process, thread (for execution), step, request, or query (for work).

Why does Task (computing) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Task (computing)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Task (computing).

Tags

  • Computing terminology

Keep exploring