A thread is a context of execution within a program. Multithreaded programming deals with designing a program to have parts of it execute concurrently.- Category ID : 58805
Most uses of synchronization code in multi-threaded applications fall into a small number of high-level “usage patterns”, or what can be called generic synchronization policies (GSPs). This paper illustrates how the use of such GSPs simplify the writing of thread-safe classes. In addition, this paper presents a C++ class library that implements commonly-used GSPs.
Explores effective uses of threads by looking at a multi-threaded implementation of the QuickSort algorithm and reports on situations where using threads will not help.
Find out what dangers race conditions in general and C++0x data races in particular pose to concurrent code, as well as the strategies for avoiding them.
Focuses on the implications of concurrency for software and its consequences for both programming languages and programmers. (Herb Sutter and James Larus)
A site devoted to lock-free algorithms, scalable architecture, multicore design patterns, parallel computations, threading libraries, tooling support and related topics.
Very lightweight stackless threads; give linear code execution for event-driven systems, designed to use little memory; library is pure C, no platform-specific Assembly; usable with or without OS. Open source, BSD-type license.
Critical sections are the One True Tool for guaranteeing mutual exclusion on shared variables. Like most tools, these must be applied consistently, and with the intended meanings.
Interprocess communication is an essential component of modern software engineering. Often, lock-free IPC is accomplished via special processor commands. This article propose a communication type that requires only atomic writing of processor word from processor cache into main memory and atomic processor word reading from main memory into the processor register or processor cache.
Explains why in the concurrent world, locality is a first-order issue that trumps most other performance considerations. Now locality is no longer just about fitting well into cache and RAM, but to avoid scalability busters by keeping tightly coupled data physically close together and separately used data far, far apart.
Presents a solution to races and deadlocks based on a well-known deadlock-avoidance protocol and shows how it can be enforced by the compiler. It can be applied to programs in which the number of locks is fixed and known up front.
Shows different ways of how to write a fast, internally synchronized queue, one that callers can use without any explicit external locking or other synchronization, and compares the performance.
So far multithreaded file I/O is a under-researched field. Although its simple to measure, there is not much common knowledge about it. The measurements presented here show that multithreading can improve performance of file access directly, as well as indirectly by utilizing available cores to process the data read.
Sharing requires waiting and overhead, and is a natural enemy of scalability. This article focuses on one important case, namely mutable (writable) shared objects in memory, which are an inherent bottleneck to scalability on multicore systems.
Motivates and illustrate best practices for using threads - techniques that will make concurrent code easier to write correctly and to reason about with confidence.
A thread pool hides a lot of details, but to use it effectively some awareness of some things a pool does under the covers is needed to avoid inadvertently hitting performance and correctness pitfalls.