Task (computing): Difference between revisions

Content deleted Content added
Filled in 2 bare reference(s) with reFill ()
Citation bot (talk | contribs)
Misc citation tidying. | Use this bot. Report bugs. | Suggested by AManWithNoPlan | #UCB_CommandLine
 
(24 intermediate revisions by 12 users not shown)
Line 1:
{{Short description|Unit of execution or work in software}}
{{Use mdy dates|date=June 2015}}
 
[[File:Thread pool.svg|thumb|400px|A sample [[thread pool]] (green boxes) with [[task queue]]s of waiting '''tasks''' (blue) and completed '''tasks''' (yellow), in the sense of task as "unit of work".]]
In [[computers|computing]], a '''task''' is a unit of [[execution (computing)|execution]]. In some [[operating system]]s, a task is synonymous with a [[process (computing)|process]], in others with a [[thread (computing)|thread]]. In [[batch processing]] computer systems, a task is a unit of execution within a [[job stream|job]].<ref>{{cite web|url=http://whatis.techtarget.com/definition/task|title=What is task? - Definition from WhatIs.com|work=WhatIs.com|accessdate=June 11, 2015}}</ref><ref>{{cite web|url=http://www.liutilities.com/articles/what-are-computer-processes/#.VXn8h0b7LDc|title=What are computer processes?|work=liutilities.com|accessdate=June 11, 2015}}</ref>
 
In [[computers|computing]], a '''task''' is a unit of [[execution (computing)|execution]] or a unit of work. The term is ambiguous; precise alternative terms include ''[[process (computing)|process]]'', [[light-weight process]], ''[[thread (computing)|thread]]'' (for execution), ''step'', ''[[request–response|request]]'', or ''query'' (for work). In the adjacent diagram, there are [[task queue|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 [[computers|computing]],the asense '''task''' is aof "unit of [[execution", (computing)|execution]]. Inin some [[operating system]]s, a task is synonymous with a [[process (computing)|process]]{{Citation needed|reason=Which operating systems?|date=November 2016}}, and in others with a [[thread (computing)|thread]]{{Citation needed|reason=Which operating systems?|date=November 2016}}. In non-interactive execution ([[batch processing]] computer systems), a task is a unit of execution within a [[job stream(computing)|job]].,<ref>{{cite web|url=http://whatis.techtarget.com/definition/task|title=What is task? - Definition from WhatIs.com|work=WhatIs.com|accessdate=June 11, 2015}}</ref><ref>{{cite web|url=http://www.liutilities.com/articles/what-are-computer-processes/#.VXn8h0b7LDc|title=What are computer processes?|work=liutilities.com|accessdate=June 11, 2015}}</ref> with the task itself typically a process. The term "[[Computer multitasking|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)|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 [https://docs.oracle.com/javase/tutorial/essential/concurrency/executors.html Executors] framework:
{{quote|When you work directly with threads, a <code>Thread</code> 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''.<ref>{{cite book |author-link = Joshua Bloch |first = Joshua |last = Bloch |title = Effective Java |edition = Third |page=[https://books.google.com/books?id=BIpDDwAAQBAJ&dq=%22the+key+abstraction+is+the+unit+of+work%22&pg=PT431 p. 272], Item 68}}</ref>}}
 
===IBM terminology===
[[IBM|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:<ref>IBM Terminology: [http://www-01.ibm.com/software/globalization/terminology/t.html T]</ref>
* 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:<ref>[http://www-01.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zglossary.doc/zglossary.html Glossary of z/OS terms and abbreviations]: [http://www-01.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zglossary.doc/zglossary.html#t T]</ref>
* "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,<ref>{{cite web
| title = <code>include/linux/sched.h</code>
| website = GitHub.com
| publisher = Linus Torvalds
| date = August 29, 2005
| url = https://github.com/torvalds/linux/blob/v2.6.13/include/linux/sched.h }}</ref> up to and including v4.8<ref>{{cite web
| title = <code>include/linux/sched.h</code>
| website = GitHub.com
| publisher = Linus Torvalds
| date = October 3, 2016
| url = https://github.com/torvalds/linux/blob/v4.8/include/linux/sched.h }}</ref>) 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 (computing)|thread]] or [[process (computing)|process]]. Tasks are brought into existence using the <code>clone()</code> system call,<ref>{{cite journal
| title = clone, __clone2 - create a child process
| journal = Linux Programmer's Manual
| url = http://man7.org/linux/man-pages/man2/clone.2.html
| date = July 17, 2016
| access-date = November 6, 2016}}</ref> 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:
{{quote |The serial model has the ability to process tasks of one job in an independent manner similar to the functioning of the [[IBM 709]].<ref>{{cite book |title=Simultaneous multiprogramming of electronic computers |year=1961 |author=James Larrimore McKenney |page=[https://books.google.com/books?id=ThYcAQAAMAAJ&q=%22tasks+of+one+job%22 154]}}</ref>}}
 
The term was popularized with the introduction of [[OS/360 and successors|OS/360]] (announced 1964), which featured [[OS/360 and successors#MFT|Multiprogramming with a Fixed number of Tasks]] (MFT) and [[OS/360 and successors#MVT|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 process]]es).
 
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 <code>.job</code> extension. By contrast, the term "[[task queue]]" is commonly used in the sense of "units of work".
 
== See also ==
* [[Task parallelism]]
* [[Task queue]]
 
== References ==
Line 8 ⟶ 64:
{{DEFAULTSORT:Task (Computing)}}
[[Category:Computing terminology]]
 
{{Compu-stub}}