Task (computing): Difference between revisions

Content deleted Content added
Terminology: Java executors
Citation bot (talk | contribs)
Misc citation tidying. | Use this bot. Report bugs. | Suggested by AManWithNoPlan | #UCB_CommandLine
 
(3 intermediate revisions by 3 users not shown)
Line 1:
{{Short description|Unit of execution or work in software}}
{{Use mdy dates|date=June 2015}}
 
Line 6 ⟶ 7:
 
==Terminology==
In the sense of "unit of execution", in 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]]), a task is a unit of execution within a [[job (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.
Line 12 ⟶ 13:
===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&lpg=PT431&ots=LwbKdbR4_b&dq=%22the%20key%20abstraction%20is%20the%20unit%20of%20work+key+abstraction+is+the+unit+of+work%22&pg=PT431#v=onepage&q=%22the%20key%20abstraction%20is%20the%20unit%20of%20work%22&f=false p. 272], Item 68}}</ref>}}
 
===IBM terminology===
Line 39 ⟶ 40:
| 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 webjournal
| title = clone, __clone2 - create a child process
| journal = Linux Programmer's Manual
Line 48 ⟶ 49:
==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&dqq=%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).