Share via


Glossary

aggregate exception. An exception that contains one or more inner exceptions, instead of only one inner exception.

aggregation**. To combine multiple data items into a single result.**

alpha blending. Merging different images into a single image by superimposing them in semitransparent layers.

antecedent task. A task whose completion starts a continuation task. An antecedent is often a future whose result value is used as input to the continuation task.

asynchronous. An operation that that does not block the current thread of control when the operation starts.

background thread. A thread that stops when a process shuts down. A running background thread does not keep a process running. Threads in the thread pool are background threads. Contrast to foreground thread.

barrier. A synchronization point where all participating threads must stop and wait until every thread reaches it. Supported in .NET by the System.Threading.Barrier class.

block. To pause execution while waiting for some event or condition.

blocking collection. A collection where removal attempts block until data is available to be removed, and additional attempts are blocked until space is available. Supported in .NET by the System.Collections.Concurrent.BlockingCollection<T> class.

captured variable. A variable defined outside a lambda expression that is used in the lambda expression. The lambda expression can update the captured variable.

cluster. A parallel computing system composed of multiple computers connected by a network, not multiple cores in a single physical processor.

closure. A lambda expression that captures variables.

concurrency. Programming with multiple activities at the same time. Concurrency enables programs to respond promptly to external stimuli; its goal is to reduce latency. Concurrency can be implemented with asynchronous operations or with threads, where it is expected that threads will take turns executing on processors. Compare to parallelism.

Concurrency Visualizer. An addition to the Visual Studio profiler that collects and displays information about the execution and performance of parallel programs.

context switch. When one thread stops executing on a processor and a different thread resumes. Excessive context switching can occur when processors are oversubscribed and can result in poor performance.

continuation task. A task that automatically starts when other tasks, known as its antecedents, complete.

control flow**. A basis for coordination where tasks execute according to the steps of an algorithm, as in a** parallel loop.

coordination. Arranging for tasks to work together to ensure a correct outcome. Coordination can be based on data flow or control flow.

core. The part of a physical processor that executes instructions. Most recent physical processor models have more than one core, so they can execute tasks in parallel.

coroutine. A generalized subroutine (method) that supports multiple entry points and can return more than once, yielding different return values. In C#, iterators are often implemented as coroutines using the yield keyword.

data flow. A basis for coordination where tasks execute when data becomes available, as in a pipeline or task graph.

data parallelism. A form of parallel processing where the same computation executes in parallel on different data. Data parallelism is supported in the Microsoft .NET Framework by the Parallel.For and Parallel.ForEach methods and by PLINQ. Compare to task parallelism.

data partitioning. Dividing a collection of data into parts, in order to use data parallelism.

data race. When more than one concurrent thread reads and writes data without synchronization.

deadlock. When execution stops and cannot resume because the system is waiting for a condition that cannot occur. Threads can deadlock when one holds resources that another needs.

decomposition. To break a problem into smaller parts. For parallel processing, decomposition can be by data or by task.

degree of parallelism. The number of parallel tasks that may execute concurrently at any one time. The degree of parallelism can be set in PLINQ by the WithDegreeOfParallelism method and can be limited in parallel loops by the MaxDegreeOfParallelism option.

dependency. When one operation uses the results of another. When there is a dependency between operations, they cannot run in parallel. Contrast to independent.

dependency injection (DI) container. A framework or library for building graphs of objects by passing in (injecting) each object's dependencies. Object lifetimes are handled by the container instead of by the consuming object.

double-checked locking. First testing a condition, then, only if the condition is true, acquiring a lock and testing the same condition again, this time to determine whether to update shared data. This maneuver can often avoid the expensive operation of acquiring a lock when it will not be useful.

dynamic partitioning. Data partitioning where the parts are selected as the parallel tasks execute. Contrast to static partitioning.

foreground thread. A thread that keeps a process running. After all its foreground threads stop, the process shuts down. Contrast to background thread.

fork/join. A parallel computing pattern that uses task parallelism. Fork occurs when tasks start; join occurs when all tasks finish.

future. A task that returns a value. In the .NET Framework, futures are implemented with the Task<TResult> class.

granularity. The quantity of data in a partition or work in a task. Equivalently, the number of data partitions or tasks. A coarse level of granularity has a few large partitions or tasks; a fine level of granularity has many small partitions or tasks.

hardware thread. An execution pipeline on a core. Simultaneous multithreading (also sometimes known as hyperthreading) enables more than one hardware thread to execute on a single core. Each hardware thread is considered a separate logical processor.

immutable. Data that cannot be modified after it's created. For example, .NET strings are immutable. Compare to mutable.

immutable type. A type whose instances are immutable. Its instances are purely functional data structures.

independent. When one operation does not use the results of another. Independent operations can execute in parallel. Contrast with dependency.

inner exception. An exception thrown and wrapped in another exception.

lambda expression. An anonymous function that can contain expressions or statements.

lazy initialization. Where data is not initialized until it is needed. Lazy initialization is supported in .NET by the Lazy<T> and LazyInitalizer classes.

livelock. When execution continues but does not make progress toward its goal.

load balancing. When similar amounts of work are assigned to different tasks, so that the available processors are used efficiently. Compare to load imbalance.

load imbalance. When different amounts of work are assigned to different tasks, so that some tasks don't have enough work to do, and the available processors are not used efficiently. Compare to load balancing.

lock. A synchronization mechanism that ensures that only one thread can execute a particular section of code at a time.

lock convoy. When multiple tasks contend repeatedly for the same lock. Frequent failures to acquire the lock can result in poor performance.

logical processor. The processor associated with a single hardware thread. In .NET, System.Environment.ProcessorCount returns the number of logical processors. Compare to physical processor.

manycore. Multicore, usually with more than eight logical processors.

map. A parallel computation where multiple tasks independently perform the same transformation on different data. An example of data parallelism.

map/reduce. A parallel programming pattern where a data parallel phase (map) is followed by an aggregation phase (reduce).

memory barrier. A machine instruction that enforces an ordering constraint on memory operations. Memory operations that precede the barrier are guaranteed to occur before operations that follow the barrier.

multicore. Having more than one core, able to execute parallel tasks. Most recent physical processor models are multicore.

multiplicity. The number of times an element occurs in a multiset.

multiset. An unordered collection that may contain duplicates. Each element in the collection is associated with a multiplicity (or count) that indicates how many times it occurs. Contrast to set.

multiset union. An operation that combines multisets by merging their elements and adding the multiplicities of each element.

mutable. Data that can be modified after it is created. For example, .NET arrays are mutable. Compare to immutable.

mutable type. A type whose instances are mutable.

nested parallelism. When one parallel programming construct appears within another. In .NET, when you use a Parallel.For loop within another Parallel.For loop, they coordinate with each other to share threading resources.

node. A computer in a cluster.

nonblocking algorithm. An algorithm that allows multiple tasks to make progress on a problem without ever blocking each other.

object graph. A data structure consisting of objects that reference each other. Object graphs are often shared mutable data that can complicate parallel programming.

overlapped I/O. I/O operations that proceed (or wait) while other tasks are executing.

oversubscription. When there are more threads than processors available to run them. Oversubscription can result in poor performance because time is spent context switching.

parallelism. Programming with multiple threads, where it is expected that threads will execute at the same time on multiple processors. Its goal is to increase throughput. Compare to concurrency.

partitioning. Dividing data into parts in order to use data parallelism.

physical processor. A processor chip, also known as a package or socket. Most recent physical processor models have more than one core and more than one logical processor per core.

pipeline. A series of producer/consumers, where each one consumes the output produced by its predecessor.

priority inversion. When a lower priority thread runs while a higher priority thread waits. This can occur when the lower priority thread holds a resource that the higher-priority thread requires.

process. A running application. Processes can run in parallel and are isolated from one another (they usually do not share data). A process can include several (or many) threads or tasks. In .NET, processes can be monitored and controlled with the System.Diagnostics.Process class. Compare to thread, task.

profiler. A tool that collects and displays information for performance analysis. The Concurrency Visualizer is a profiler for concurrent and parallel programs.

pure function. A function (or method or operation) that has no side effects (does not update any data nor produce any output) but returns only a value.

purely functional data structure. A data structure that can only be accessed by pure functions. An instance of an immutable type.

race. When the outcome of a computation depends on which statement executes first, but the order of execution is not controlled or synchronized.

race condition. A condition where a race occurs. Race conditions are usually errors; good programming practices prevent them.

recursive decomposition. In parallel programming, where the tasks themselves can start more tasks.

reduce. A kind of aggregation where data is combined by an operation that is associative, which often makes it possible to perform much of the reduction in parallel.

round robin. A scheduling algorithm where each thread is given its turn to run in a fixed order in a repeating cycle, so that during each cycle, each thread runs once.

scalable. A parallel computation whose performance increases when more processors are available.

semaphore. A synchronization mechanism that ensures not more than a specified number of threads can execute a particular section of code at a time. Compare to lock.

serialize. To run in sequence, not in parallel.

set. An unordered collection without duplicates. Compare to multiset.

shared data. Data used by more than one thread. Access to mutable shared data requires synchronization.

single-threaded data type. A type that is not thread-safe. It cannot be accessed by multiple threads unless there is additional synchronization in user code.

simultaneous multithreading (SMT). A technique for executing multiple threads on a single core.

socket. Physical processor.

speculative execution. To execute tasks even though their results may not be needed.

static partitioning. Data partitioning where the parts are selected before the program executes. Contrast to dynamic partitioning.

synchronization. Coordinating the actions of threads to ensure a correct outcome. A lock is an example of a synchronization mechanism.

task. A parallelizable unit of work. A task executes in a thread but is not the same as a thread; it is at a higher level of abstraction. Tasks are recommended for parallel programming in .NET with the Task Parallel Library in the System.Threading.Tasks namespace. Compare to thread, process.

task graph. When tasks provide results that are the inputs to other tasks, this can be seen as a directed graph. The nodes are tasks, and the arcs are values that act as inputs and outputs of the tasks.

task inlining. When more than one task executes in a single thread concurrently due to one task requesting that the other task run synchronously at the current point of execution.

task parallelism. A form of parallel processing where different computations execute in parallel on different data. Task parallelism is supported in .NET by the Parallel.Invoke and Task.Factory.StartNew methods. Compare to data parallelism.

thread. An executing sequence of statements. Several (or many) threads can run within a single process. Threads are not isolated; all the threads in a process share data. A thread can run a task but is not the same as a task; it is at a lower level of abstraction. Threads are supported in .NET by the System.Threading namespace. Compare to process, task.

thread affinity. When certain operations must only be performed by a particular thread. For example, a Windows Presentation Foundation (WPF) control must be accessed from the same thread that created it.

thread injection. To add threads to the thread pool.

thread pool. A collection of threads managed by .NET to avoid the overhead of creating and disposing threads. Tasks are usually run by threads in the thread pool.

thread starvation. When tasks are unable to run because there are no threads available to run them in the thread pool.

thread-local state. Variables that are accessed by only one thread. No locking or other synchronization is needed to safely access thread-local state. Thread-local state is supported in .NET by the ThreadStatic attribute and the ThreadLocal class.

thread-safe. A type that can be used concurrently by multiple threads, without requiring additional synchronization in user code. A thread-safe type ensures that its data can be accessed by only one thread at a time, and its operations are atomic with respect to multiple threads. The .NET System.Collections.Concurrent namespace provides several thread-safe collection types. Compare to single-threaded data type.

torn read. When reading a variable requires more than one machine instruction, and another task writes to the variable between the read instructions.

torn write. When writing a variable requires more than one machine instruction, and another task reads the variable between the write instructions.

tuple. An unnamed record containing an ordered list of elements. Tuples are supported in .NET by the Tuple classes.

two-step dance. To signal an event while holding a lock, when the waking thread needs to acquire that lock. It will wake only to find that it must wait again. This can cause context switching and poor performance.

undersubscription. When there are fewer tasks than there are processors available to run them, so processors remain idle.

virtual core. Logical processor.

volatile. A keyword that tells the C# compiler that a field can be modified by multiple threads, the operating system, or other hardware.

work stealing. When a thread executes a task queued for another thread in the thread pool, in order to remain busy.

XAML. A declarative markup language used in the .NET Framework programming model to specify the user interface (UI) for .NET applications.

Next | Previous | Home | Community