In
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includin ...
, a task context is the minimal set of data used by a task (which may be a
process
A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic.
Things called a process include:
Business and management
*Business process, activities that produce a specific se ...
,
thread
Thread may refer to:
Objects
* Thread (yarn), a kind of thin yarn used for sewing
** Thread (unit of measurement), a cotton yarn measure
* Screw thread, a helical ridge on a cylindrical fastener
Arts and entertainment
* ''Thread'' (film), 2016 ...
, or
fiber
Fiber or fibre (from la, fibra, links=no) is a natural or artificial substance that is significantly longer than it is wide. Fibers are often used in the manufacture of other materials. The strongest engineering materials often incorpora ...
) that must be saved to allow a task to be
interrupt
In digital computers, an interrupt (sometimes referred to as a trap) is a request for the processor to ''interrupt'' currently executing code (when permitted), so that the event can be processed in a timely manner. If the request is accepted ...
ed, and later continued from the same point. The concept of context assumes significance in the case of interruptible tasks, wherein, upon being interrupted, the processor saves the context and proceeds to serve the
interrupt service routine. Thus, the smaller the context is, the smaller the latency is.
The context data may be located in
processor register
A processor register is a quickly accessible location available to a computer's processor. Registers usually consist of a small amount of fast storage, although some registers have specific hardware functions, and may be read-only or write-only. ...
s, memory used by the task, or in
control register
A control register is a processor register which changes or controls the general behavior of a CPU or other digital device. Common tasks performed by control registers include interrupt control, switching the addressing mode, paging control, ...
s used by some
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s to manage the task.
The storage memory (files used by a task) is not concerned by the "task context" in the case of a
context switch
In computing, a context switch is the process of storing the state of a process or thread, so that it can be restored and resume execution at a later point, and then restoring a different, previously saved, state. This allows multiple processes ...
, even if this can be stored for some uses (checkpointing).
Context types
In some computer languages like C#, there is also the concept of ''safe''/''secure context''. For instance, if an
array
An array is a systematic arrangement of similar objects, usually in rows and columns.
Things called an array include:
{{TOC right
Music
* In twelve-tone and serial composition, the presentation of simultaneous twelve-tone sets such that the ...
is needed inside a
structure, it can be added to it since version 2.0, but only in an unsafe/unsecure context.
Structures in C# 2.0
/ref> Here is an example code:
struct ParameterRepresentation
;
Th
fixed
keyword prevents the garbage collector from relocating this variable. The access to an array is like in C++, i.e. using pointer arithmetic, where individual elements of the array can be accessed over its indices.
See also
* State (computer science)
Context and Adaptivity in Pervasive Computing Environments: Links with Software Engineering and Ontological Engineering
article in Journal of Software, Vol 4, No 9 (2009), 992-1013, Nov 2009 by Ahmet Soylu, Patrick De Causmaecker and Piet Desmet
References
External links
Context
S-Cube Knowledge Model
{{DEFAULTSORT:Context (Computing)
Process (computing)