![]() |
MySQL 26.7.0
Source Code Documentation
|
Padded slot for Sync_bounded_queue, aligning the struct to cache line size to minimize false sharing in concurrent access. More...
#include <padded_slot.h>
Public Attributes | |
| T | element {} |
| The stored element in the queue slot. More... | |
| bool | validity {false} |
| Validity flag: true if the slot contains an element ready for consumption, false if empty. More... | |
| Mutex_tp | validity_mt |
| Mutex protecting access to the element and flags. More... | |
| Cv_tp | producer_cv |
| Condition variable for producers waiting for the slot to become free (full queue). More... | |
| Cv_tp | consumer_cv |
| Condition variable for consumers waiting for the slot to be filled (empty queue). More... | |
Padded slot for Sync_bounded_queue, aligning the struct to cache line size to minimize false sharing in concurrent access.
Holds an element, validity flag, mutex, and condition variables for producer-consumer synchronization. Each slot is padded to prevent adjacent slots from sharing cache lines, reducing contention in multi-threaded environments.
| T | Element type. |
| Mutex_tp | Mutex type |
| Cv_tp | Condition variable type |
| cache_line_size_tp | Padding size (default: hardware_destructive_interference_size). |
| Cv_tp mysql::concurrency::detail::Padded_slot< T, Mutex_tp, Cv_tp, cache_line_size_tp >::consumer_cv |
Condition variable for consumers waiting for the slot to be filled (empty queue).
| T mysql::concurrency::detail::Padded_slot< T, Mutex_tp, Cv_tp, cache_line_size_tp >::element {} |
The stored element in the queue slot.
| Cv_tp mysql::concurrency::detail::Padded_slot< T, Mutex_tp, Cv_tp, cache_line_size_tp >::producer_cv |
Condition variable for producers waiting for the slot to become free (full queue).
| bool mysql::concurrency::detail::Padded_slot< T, Mutex_tp, Cv_tp, cache_line_size_tp >::validity {false} |
Validity flag: true if the slot contains an element ready for consumption, false if empty.
| Mutex_tp mysql::concurrency::detail::Padded_slot< T, Mutex_tp, Cv_tp, cache_line_size_tp >::validity_mt |
Mutex protecting access to the element and flags.