#include <trx0sys.h>
|
static std::atomic< trx_id_t > | s_lower_bound {0} |
| This value is guaranteed to be always smaller or equal than any id in any of the shards of transactions which finished calling insert(id). More...
|
|
static std::atomic< trx_id_t > | s_lower_bound_candidate {0} |
| This is used during get_better_lower_bound_for_already_active_id() to announce that it is trying to establish new value for s_lower_bound, and this is the current candidate. More...
|
|
◆ By_id
◆ by_id()
By_id const & Trx_by_id_with_min::by_id |
( |
| ) |
const |
|
inline |
◆ erase()
void Trx_by_id_with_min::erase |
( |
trx_id_t |
trx_id | ) |
|
|
inline |
◆ get()
◆ get_better_lower_bound_for_already_active_id()
trx_id_t Trx_by_id_with_min::get_better_lower_bound_for_already_active_id |
( |
| ) |
|
|
static |
- See also
- get_cheap_lower_bound_for_already_active_id() from which this function differs by executing a tighter estimation. If it is indeed better, then as a side effect it will bump the value of s_lower_bound used by get_cheap_lower_bound_for_already_active_id()
◆ get_cheap_lower_bound_for_already_active_id()
static trx_id_t Trx_by_id_with_min::get_cheap_lower_bound_for_already_active_id |
( |
| ) |
|
|
inlinestatic |
Returns a value which is lower or equal to id of any transaction for which insert(id) happened before the call started, and erase(id) has not happened before the start of the call.
- See also
- s_lower_bound Note that this value never increases unless someone calls
-
get_better_lower_bound_for_already_active_id()
◆ insert()
void Trx_by_id_with_min::insert |
( |
trx_t & |
trx | ) |
|
|
inline |
◆ limit_to()
static void Trx_by_id_with_min::limit_to |
( |
std::atomic< trx_id_t > & |
a, |
|
|
trx_id_t |
upper_bound |
|
) |
| |
|
inlinestaticprivate |
Performs an equivalent of if(upper_bound<v)v=upper_bound atomically.
- Parameters
-
[in] | a | The atomic we want to limit to upper_bound |
[in] | upper_bound | The upper_bound we want to impose on a |
◆ min_id()
trx_id_t Trx_by_id_with_min::min_id |
( |
| ) |
const |
|
inline |
◆ m_by_id
By_id Trx_by_id_with_min::m_by_id |
|
private |
◆ m_min_id
For observers which use Trx_shard::mutex protection: each transaction id in the m_by_id is guaranteed to be at least m_min_id.
Writes are protected with Trx_shard::mutex. Reads can be performed without any latch before accessing m_by_id, but care must be taken to interpret the result -
- See also
- trx_rw_is_active for details.
◆ s_lower_bound
std::atomic< trx_id_t > Trx_by_id_with_min::s_lower_bound {0} |
|
staticprivate |
This value is guaranteed to be always smaller or equal than any id in any of the shards of transactions which finished calling insert(id).
I.e. a shard can already contain an id smaller than this value, if insert(id) has still not finished. This is sufficient guarantee, if you only care about "active" transactions in the sense that insert(id) for them has happened before the call. For example, when you want to check if a record you look at could have been modified by any of active transactions, then this is a valid assumption as creating a record happens after insert(id). This value may be way lower than actual minimum, as it is only updated from time to time by get_better_lower_bound_for_already_active_id().
◆ s_lower_bound_candidate
std::atomic< trx_id_t > Trx_by_id_with_min::s_lower_bound_candidate {0} |
|
staticprivate |
This is used during get_better_lower_bound_for_already_active_id() to announce that it is trying to establish new value for s_lower_bound, and this is the current candidate.
This value is 0 if no such process is under way, and changed to non-zero by the only thread chosen to perform it, thus it also serves the purpose of "mutex". Transactions executing insert(id) should limit this atomic to id, to help the process.
The documentation for this class was generated from the following files: