MySQL 9.0.0
Source Code Documentation
locksys::Latches::Page_shards Class Reference

Public Member Functions

 Page_shards ()
 
 ~Page_shards ()
 
const Lock_mutexget_mutex (const page_id_t &page_id) const
 Returns the mutex which (together with the global latch) protects the page shard which contains record locks for records from the given page. More...
 
Lock_mutexget_mutex (const page_id_t &page_id)
 Returns the mutex which (together with the global latch) protects the page shard which contains record locks for records from the given page. More...
 

Static Private Member Functions

static size_t get_shard (const page_id_t &page_id)
 Identifies the page shard which contains record locks for records from the given page. More...
 

Private Attributes

Padded_mutex mutexes [SHARDS_COUNT]
 Each shard is protected by a separate mutex. More...
 

Constructor & Destructor Documentation

◆ Page_shards()

locksys::Latches::Page_shards::Page_shards ( )

◆ ~Page_shards()

locksys::Latches::Page_shards::~Page_shards ( )

Member Function Documentation

◆ get_mutex() [1/2]

Lock_mutex & locksys::Latches::Page_shards::get_mutex ( const page_id_t page_id)

Returns the mutex which (together with the global latch) protects the page shard which contains record locks for records from the given page.

Parameters
[in]page_idThe space_id and page_no of the page
Returns
The mutex responsible for the shard containing the page

◆ get_mutex() [2/2]

const Lock_mutex & locksys::Latches::Page_shards::get_mutex ( const page_id_t page_id) const

Returns the mutex which (together with the global latch) protects the page shard which contains record locks for records from the given page.

Parameters
[in]page_idThe space_id and page_no of the page
Returns
The mutex responsible for the shard containing the page

◆ get_shard()

size_t locksys::Latches::Page_shards::get_shard ( const page_id_t page_id)
staticprivate

Identifies the page shard which contains record locks for records from the given page.

Parameters
[in]page_idThe space_id and page_no of the page
Returns
Integer in the range [0..lock_sys_t::SHARDS_COUNT)

Member Data Documentation

◆ mutexes

Padded_mutex locksys::Latches::Page_shards::mutexes[SHARDS_COUNT]
private

Each shard is protected by a separate mutex.

Mutexes are padded to avoid false sharing issues with cache.


The documentation for this class was generated from the following files: