CUBRID Engine  latest
lockfree::bitmap Class Reference

#include <lockfree_bitmap.hpp>

Collaboration diagram for lockfree::bitmap:
Collaboration graph

Public Types

enum  chunking_style { ONE_CHUNK = 0, LIST_OF_CHUNKS }
 

Public Member Functions

 bitmap ()
 
 ~bitmap ()
 
void init (chunking_style style, int entries_count, float usage_ratio)
 
void destroy ()
 
int get_entry ()
 
void free_entry (int entry_idx)
 
bool is_full () const
 

Public Attributes

std::atomic< unsigned int > * bitfield
 
int entry_count
 
std::atomic< int > entry_count_in_use
 
chunking_style style
 
float usage_threshold
 
std::atomic< unsigned int > start_idx
 

Static Public Attributes

static const float FULL_USAGE_RATIO = 1.0f
 
static const float NINTETYFIVE_PERCENTILE_USAGE_RATIO = 0.95f
 

Detailed Description

Definition at line 31 of file lockfree_bitmap.hpp.

Member Enumeration Documentation

Enumerator
ONE_CHUNK 
LIST_OF_CHUNKS 

Definition at line 37 of file lockfree_bitmap.hpp.

Constructor & Destructor Documentation

lockfree::bitmap::bitmap ( )

Definition at line 35 of file lockfree_bitmap.cpp.

References FULL_USAGE_RATIO, start_idx, style, and usage_threshold.

lockfree::bitmap::~bitmap ( )

Definition at line 45 of file lockfree_bitmap.cpp.

References destroy().

Member Function Documentation

void lockfree::bitmap::destroy ( )

Definition at line 57 of file lockfree_bitmap.cpp.

References lockfree::lf_bitmap_destroy().

Referenced by area_alloc(), area_flush(), lf_tran_system_destroy(), lf_tran_system_init(), and ~bitmap().

Here is the caller graph for this function:

void lockfree::bitmap::free_entry ( int  entry_idx)

Definition at line 69 of file lockfree_bitmap.cpp.

References lockfree::lf_bitmap_free_entry().

Referenced by area_free(), lockfree::tran::system::free_index(), and lf_tran_return_entry().

Here is the caller graph for this function:

int lockfree::bitmap::get_entry ( )

Definition at line 63 of file lockfree_bitmap.cpp.

References lockfree::lf_bitmap_get_entry().

Referenced by area_alloc(), lockfree::tran::system::assign_index(), and lf_tran_request_entry().

Here is the caller graph for this function:

void lockfree::bitmap::init ( chunking_style  style,
int  entries_count,
float  usage_ratio 
)

Definition at line 51 of file lockfree_bitmap.cpp.

References lockfree::lf_bitmap_init().

Referenced by area_alloc_block(), lf_tran_system_init(), and lockfree::tran::system::system().

Here is the caller graph for this function:

bool lockfree::bitmap::is_full ( ) const

Definition at line 75 of file lockfree_bitmap.cpp.

References entry_count, entry_count_in_use, and usage_threshold.

Member Data Documentation

std::atomic<int> lockfree::bitmap::entry_count_in_use
const float lockfree::bitmap::FULL_USAGE_RATIO = 1.0f
static

Definition at line 34 of file lockfree_bitmap.hpp.

Referenced by bitmap(), and lockfree::tran::system::system().

const float lockfree::bitmap::NINTETYFIVE_PERCENTILE_USAGE_RATIO = 0.95f
static

Definition at line 35 of file lockfree_bitmap.hpp.

std::atomic<unsigned int> lockfree::bitmap::start_idx
float lockfree::bitmap::usage_threshold

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