Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

Locks, Mutexes, and Semaphores

15

Flashcards

0/15

Still learning
StarStarStarStar

Priority Inversion

StarStarStarStar

Operation: A lower-priority thread holds a resource that a higher-priority thread needs, but the lower-priority thread is preempted by medium-priority threads. Use Case: Debugging unexpected application behavior due to suboptimal task scheduling.

StarStarStarStar

Starvation

StarStarStarStar

Operation: A thread is perpetually denied access to a shared resource or lock. Use Case: Diagnosing fairness issues in thread scheduling and resource allocation.

StarStarStarStar

Condition Variable

StarStarStarStar

Operation: Blocks the thread until a certain condition is met. Use Case: Allows threads to wait for certain conditions to be true before proceeding.

StarStarStarStar

Lock-Free Algorithms

StarStarStarStar

Operation: Algorithms designed so that multiple threads can operate on shared data without using locks, avoiding potential deadlocks. Use Case: Creating scalable and responsive multi-threaded programs.

StarStarStarStar

Read-Write Lock (Shared-Exclusive Lock)

StarStarStarStar

Operation: Differentiates access based on the operation (read or write), allowing multiple readers or one writer. Use Case: Optimizing performance when a resource is read more often than written to.

StarStarStarStar

Barrier

StarStarStarStar

Operation: Synchronizes a group of threads at a certain point in the program, ensuring all have reached the barrier before continuing. Use Case: Coordinating phased work, like in parallel algorithms where threads proceed in lockstep.

StarStarStarStar

Livelock

StarStarStarStar

Operation: A situation where threads remain active but are unable to make further progress. Use Case: Similar to deadlock in terms of thread starvation but with continuous state changes.

StarStarStarStar

Atomic Operations

StarStarStarStar

Operation: Operations that complete in a single step relative to other threads. Use Case: Implementing lock-free data structures and performing thread-safe operations without locking.

StarStarStarStar

Spinlock

StarStarStarStar

Operation: A type of lock that waits in a loop ('spins') while repeatedly checking if the lock is available. Use Case: Efficient in scenarios where the wait is expected to be very short.

StarStarStarStar

Monitor

StarStarStarStar

Operation: An abstract data type that controls access to shared resources with built-in synchronization primitives. Use Case: Simplifying the design of thread-safe classes by encapsulating access control.

StarStarStarStar

Semaphore

StarStarStarStar

Operation: A signaling mechanism that uses a counter to control access by multiple threads to a common resource. Use Case: Managing a fixed number of identical resources shared among threads.

StarStarStarStar

Mutex (Mutual Exclusion)

StarStarStarStar

Operation: Allows only one thread to access a resource at a time. Use Case: Protecting access to shared data in a multithreaded application.

StarStarStarStar

Deadlock

StarStarStarStar

Operation: Occurs when two or more threads are unable to proceed because each is waiting for the other to release a lock. Use Case: Understanding and troubleshooting thread starvation and unresponsive applications.

StarStarStarStar

Transaction Memory

StarStarStarStar

Operation: A concurrency control mechanism for simplifying the synchronization of threads that share memory. Use Case: Writing code that is automatically synchronized at the level of memory transactions.

StarStarStarStar

Futex (Fast Userspace Mutex)

StarStarStarStar

Operation: A lightweight, fast synchronization primitive that operates in user space until it detects contention, at which point it requests kernel help. Use Case: Efficiently handling infrequent contention in multithreaded applications.

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.