Context (computing)
In computer science, a task context (process, thread ...) is the minimal set of data used by this task that must be saved to allow a task interruption at a given date, and a continuation of this task at the point it has been interrupted and at an arbitrary future date. 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.
These data are located in:
- Processor registers
- Memory used by the task
- On some Operating systems, control registers used by the system to manage the task
The storage memory (files) is not concerned by the "task context" in the case of a context switch; 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 is needed inside a structure, it can be added to it since version 2.0, but only in an unsafe/unsecure context.[1] Here is an example code:
struct ParameterRepresentation { char target; char taskStart; char taskType; fixed byte traceValues[m_MAX_BYTES]; };
The 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 indexes.
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