In
computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, 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 s ...
,
thread, or
fiber
Fiber (spelled fibre in British English; from ) 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 inco ...
) 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-onl ...
s, memory used by the task, or in
control registers used by some
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s to directly 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, even if this can be stored for some uses (checkpointing).
The context can also be viewed as a mechanism that allows a
state
State most commonly refers to:
* State (polity), a centralized political organization that regulates law and society within a territory
**Sovereign state, a sovereign polity in international law, commonly referred to as a country
**Nation state, a ...
of a program to be transferred between its components.
Context types
In some computer languages like C#, there is also the concept of ''safe''/''secure context''. For instance, if an
array is needed inside a
structure
A structure is an arrangement and organization of interrelated elements in a material object or system, or the object or system so organized. Material structures include man-made objects such as buildings and machines and natural objects such as ...
, 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)
In information technology and computer science, a system is described as stateful if it is designed to remember preceding events or user interactions; the remembered information is called the state of the system.
The set of states a system can oc ...
* Task (computing)
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'' (fo ...
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)