首页 技术 正文
技术 2022年11月17日
0 收藏 414 点赞 3,594 浏览 4255 个字
/** Buffer page (uncompressed or compressed) */typedef    struct buf_page_struct        buf_page_t;struct buf_page_struct{    /** @name General fields    None of these bit-fields must be modified without holding    buf_page_get_mutex() [buf_block_struct::mutex or    buf_pool->zip_mutex], since they can be stored in the same    machine word.  Some of these fields are additionally protected    by buf_pool->mutex. */    /* @{ */    unsigned    space:;    /*!< tablespace id; also protected                    by buf_pool->mutex. */    unsigned    offset:;    /*!< page number; also protected                    by buf_pool->mutex. */    unsigned    state:BUF_PAGE_STATE_BITS;                    /*!< state of the control block; also                    protected by buf_pool->mutex.                    State transitions from                    BUF_BLOCK_READY_FOR_USE to                    BUF_BLOCK_MEMORY need not be                    protected by buf_page_get_mutex().                    @see enum buf_page_state */#ifndef UNIV_HOTBACKUP    unsigned    flush_type:;    /*!< if this block is currently being                    flushed to disk, this tells the                    flush_type.                    @see enum buf_flush */    unsigned    io_fix:;    /*!< type of pending I/O operation;                    also protected by buf_pool->mutex                    @see enum buf_io_fix */    unsigned    buf_fix_count:;/*!< count of how manyfold this block                    is currently bufferfixed */    unsigned    buf_pool_index:;/*!< index number of the buffer pool                    that this block belongs to */##  error "MAX_BUFFER_POOLS > 64; redefine buf_pool_index:6"# endif    /* @} */#endif /* !UNIV_HOTBACKUP */    page_zip_des_t    zip;        /*!< compressed page; zip.data                    (but not the data it points to) is                    also protected by buf_pool->mutex;                    state == BUF_BLOCK_ZIP_PAGE and                    zip.data == NULL means an active                    buf_pool->watch */#ifndef UNIV_HOTBACKUP    buf_page_t*    hash;        /*!< node used in chaining to                    buf_pool->page_hash or                    buf_pool->zip_hash */#ifdef UNIV_DEBUG    ibool        in_page_hash;    /*!< TRUE if in buf_pool->page_hash */    ibool        in_zip_hash;    /*!< TRUE if in buf_pool->zip_hash */#endif /* UNIV_DEBUG */    /** @name Page flushing fields    All these are protected by buf_pool->mutex. */    /* @{ */    

    /** 该方式很新颖

    #define UT_LIST_NODE_T(TYPE)\
      struct {\
        TYPE *prev;/*!< pointer to the previous node,NULL if start of list */\
        TYPE *next;/*!< pointer to next node, NULL if end of list */\
      }\

    */    UT_LIST_NODE_T(buf_page_t) list;                    /*!< based on state, this is a                    list node, protected either by                    buf_pool->mutex or by                    buf_pool->flush_list_mutex,                    in one of the following lists in                    buf_pool:                    - BUF_BLOCK_NOT_USED:    free                    - BUF_BLOCK_FILE_PAGE:    flush_list                    - BUF_BLOCK_ZIP_DIRTY:    flush_list                    - BUF_BLOCK_ZIP_PAGE:    zip_clean                    - BUF_BLOCK_ZIP_FREE:    zip_free[]                    If bpage is part of flush_list                    then the node pointers are                    covered by buf_pool->flush_list_mutex.                    Otherwise these pointers are                    protected by buf_pool->mutex.                    The contents of the list node                    is undefined if !in_flush_list                    && state == BUF_BLOCK_FILE_PAGE,                    or if state is one of                    BUF_BLOCK_MEMORY,                    BUF_BLOCK_REMOVE_HASH or                    BUF_BLOCK_READY_IN_USE. */#ifdef UNIV_DEBUG    ibool        in_flush_list;    /*!< TRUE if in buf_pool->flush_list;                    when buf_pool->flush_list_mutex is                    free, the following should hold:                    in_flush_list                    == (state == BUF_BLOCK_FILE_PAGE                        || state == BUF_BLOCK_ZIP_DIRTY)                    Writes to this field must be                    covered by both block->mutex                    and buf_pool->flush_list_mutex. Hence                    reads can happen while holding                    any one of the two mutexes */    ibool        in_free_list;    /*!< TRUE if in buf_pool->free; when                    buf_pool->mutex is free, the following                    should hold: in_free_list                    == (state == BUF_BLOCK_NOT_USED) */#endif /* UNIV_DEBUG */    ib_uint64_t    newest_modification;                    /*!< log sequence number of                    the youngest modification to                    this block, zero if not                    modified. Protected by block                    mutex */    ib_uint64_t    oldest_modification;                    /*!< log sequence number of                    the START of the log entry                    written of the oldest                    modification to this block                    which has not yet been flushed                    on disk; zero if all                    modifications are on disk.                    Writes to this field must be                    covered by both block->mutex                    and buf_pool->flush_list_mutex. Hence                    reads can happen while holding                    any one of the two mutexes */    /* @} */    /** @name LRU replacement algorithm fields    These fields are protected by buf_pool->mutex only (not    buf_pool->zip_mutex or buf_block_struct::mutex). */    /* @{ */    UT_LIST_NODE_T(buf_page_t) LRU;                    /*!< node of the LRU list */#ifdef UNIV_DEBUG    ibool        in_LRU_list;    /*!< TRUE if the page is in                    the LRU list; used in                    debugging */#endif /* UNIV_DEBUG */    unsigned    old:;        /*!< TRUE if the block is in the old                    blocks in buf_pool->LRU_old */    unsigned    freed_page_clock:;/*!< the value of                    buf_pool->freed_page_clock                    when this block was the last                    time put to the head of the                    LRU list; a thread is allowed                    to read this for heuristic                    purposes without holding any                    mutex or latch */    /* @} */    unsigned    access_time;    /*!< time of first access, or                    0 if the block was never accessed                    in the buffer pool. Protected by                    block mutex */# if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG    ibool        file_page_was_freed;                    /*!< this is set to TRUE when fsp                    frees a page in buffer pool */# endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */#endif /* !UNIV_HOTBACKUP */};
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,085
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,560
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,409
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,182
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,819
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,902