1/14
Vocabulary flashcards covering the producer-consumer problem, work decomposition methods, and Pthread condition variable synchronization.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Data decomposition
A work-dividing strategy where different threads/processes execute the same function on different data.
Task decomposition
A work-dividing strategy where different threads/processes execute different functions.
Data-flow decomposition
A configuration where one thread executes a function to produce output data, while another thread executes a different function to consume that data.
Producer thread/process
An entity that produces data items and places them into a shared buffer.
Consumer thread/process
An entity that removes data items from a shared buffer to consume them.
Bounded buffer problem
Another name for the producer-consumer problem, which requires maintaining buffer consistency without busy waiting.
pthread_cond_t
The data type used for a condition variable in the Pthread library.
PTHREAD_COND_INITIALIZER
The macro used to initialize a condition variable with default attributes.
pthread_cond_wait()
A function that takes the address of a condition variable and the address of a mutex variable to allow a thread to sleep until a condition is met.
pthread_cond_signal()
A function that takes the address of a condition variable to wake up a thread waiting on that condition.
not_empty
A condition variable name typically used to reflect that the buffer contains at least one item for the consumer.
not_full
A condition variable name typically used to reflect that the buffer has at least one empty space for the producer.
N
The buffer capacity, which is defined as 10 in the sample code provided.
count
A shared variable used to keep track of the number of items currently in the buffer.
pthread_mutex_t
The data type for a mutex variable used for synchronization based on the state or value of shared data.