1/23
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Pthreads
A POSIX standard for implementing threads in C/C++ that allows multiple threads to execute within a single process.
Mutex
A mutex (mutual exclusion) is a locking mechanism that prevents simultaneous access to a critical section by multiple threads.
Critical Section
A part of the code that accesses shared resources and must be executed by only one thread at a time to avoid inconsistent results.
Race Condition
A situation in which the outcome of a program depends on the sequence or timing of uncontrollable events, usually due to shared variable access.
Semaphore
A synchronization primitive that allows threads to signal each other, often used for controlling access to a common resource.
Thread Safety
A property of a block of code that guarantees safe execution when accessed by multiple threads concurrently.
Barrier
A synchronization point where threads wait until all threads have reached it before any can proceed.
POSIX Threads API
A set of C functions provided for creating and controlling threads in POSIX-compliant operating systems.
Thread Synchronization
Mechanisms that are used to coordinate the execution of threads, ensuring that data is accessed in a controlled manner.
Condition Variable
A synchronization primitive that enables threads to wait for certain conditions within a mutex guarded context.
Read-Write Lock
A special type of lock that allows concurrent access for read operations but exclusive access for write operations.
Producer-Consumer Problem
A classic synchronization problem where one or more threads (producers) generate data and put it in a buffer, and another thread (consumer) takes data from that buffer.
Thread Creation
The process of generating a new thread of execution within a process, typically using the pthread_create function.
pthread_join
A Pthreads function that waits for a specified thread to terminate, allowing the main thread to synchronize with other threads.
Thread Count
The total number of threads that a multi-threaded program will create for execution.
Busy Waiting
A technique where a thread repeatedly checks for a condition, potentially wasting CPU cycles while waiting.
Global Variable
A variable declared outside of all functions, accessible by all threads within the same process, potentially leading to race conditions if modified.
Thread Function
The function that a thread executes when created, typically taking a single void pointer argument.
Linking with Pthreads
Including the pthread library when compiling a C program, usually with the -lpthread flag.
Data Race
A condition in concurrent programming where two threads access shared data at the same time, and at least one of them is a write.
pthread_mutex_lock
A Pthreads function that locks a mutex, blocking other threads from entering the critical section until the mutex is unlocked.
pthread_mutex_unlock
A Pthreads function that unlocks a mutex, allowing other threads to enter the critical section.
Race Condition Prevention
Techniques such as mutexes, semaphores, and barriers used to prevent unintended interactions between threads.
Linked List in Pthreads
A data structure that can be accessed by multiple threads which requires proper synchronization to prevent race conditions during Insert, Delete, and Member operations.