Relativistic programming (RP) is a style of
concurrent programming
Concurrent means happening at the same time. Concurrency, concurrent, or concurrence may refer to:
Law
* Concurrence, in jurisprudence, the need to prove both ''actus reus'' and ''mens rea''
* Concurring opinion (also called a "concurrence"), a ...
where instead of trying to avoid conflicts between readers and writers (or writers and writers in some cases) the algorithm is designed to tolerate them and get a correct result regardless of the order of events. Also, relativistic programming algorithms are designed to work without the presences of a global order of events. That is, there may be some cases where one thread sees two events in a different order than another thread (hence the term relativistic because in
Einstein's theory of special relativity the order of events is not always the same to different viewers). This essentially implies working under
causal consistency Causal consistency is one of the major memory consistency models. In concurrent programming, where concurrent processes are accessing a shared memory, a consistency model restricts which accesses are legal. This is useful for defining correct data ...
instead of a stronger model.
Relativistic programming provides advantages in performance compared to other concurrency paradigms because it does not require one thread to wait for another nearly as often. Because of this, forms of it (
Read-Copy-Update In computer science, read-copy-update (RCU) is a synchronization mechanism that avoids the use of lock primitives while multiple threads concurrently read and update elements that are linked through pointers and that belong to shared data structu ...
for instance) are now used extensively in the
Linux kernel
The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU ...
(over 18,000 times and has grown from nothing to 11.8% of all locking primitives in just under two decades).
See also
*
Non-blocking algorithm
In computer science, an algorithm is called non-blocking if failure or suspension of any thread cannot cause failure or suspension of another thread; for some operations, these algorithms provide a useful alternative to traditional blocking im ...
References
External links
Relativistic Programmingat
Portland State University
Portland State University (PSU) is a public research university in Portland, Oregon. It was founded in 1946 as a post-secondary educational institution for World War II veterans. It evolved into a four-year college over the following two decades ...
Concurrent computing
{{comp-sci-stub