Skip to content

File unittests_lf.c

FileList > cubrid > src > executables > unittests_lf.c

Go to the source code of this file

  • #include "porting.h"
  • #include "lock_free.h"
  • #include <stdio.h>
  • #include <pthread.h>
  • #include <time.h>
  • #include <sys/time.h>
  • #include <assert.h>

Classes

Type Name
struct xentry

Public Types

Type Name
typedef struct xentry XENTRY
typedef lf_hash_table_cpp< int, xentry > my_hashmap
typedef my_hashmap::iterator my_hashmap_iterator

Public Static Attributes

Type Name
int del_op_count = -1
int random_numbers
struct timeval start_time
LF_ENTRY_DESCRIPTOR xentry_desc = /* multi line expression */

Public Functions

Type Name
int main (int argc, char ** argv)
void * test_clear_proc_1 (void * param)
void * test_clear_proc_2 (void * param)
void * test_clear_proc_3 (void * param)
void * test_freelist_proc (void * param)
void * test_freelist_proc_local_tran (void * param)
void * test_hash_proc_1 (void * param)
void * test_hash_proc_2 (void * param)
void * test_hash_proc_3 (void * param)

Public Static Functions

Type Name
void begin (const char * test_name)
int fail (const char * message)
void generate_random ()
int success ()
int test_freelist (LF_ENTRY_DESCRIPTOR * edesc, int nthreads, bool test_local_tran)
int test_hash_iterator ()
int test_hash_table (LF_ENTRY_DESCRIPTOR * edesc, int nthreads, void *(*)(void *) proc)
void * xentry_alloc ()
int xentry_free (void * entry)
unsigned int xentry_hash (void * key, int htsize)
int xentry_init (void * entry)
int xentry_key_compare (void * k1, void * k2)
int xentry_key_copy (void * src, void * dest)
int xentry_uninit (void * entry)

Macros

Type Name
define HASH_POPULATION [**HASH\_SIZE**](unittests__lf_8c.md#define-hash_size) \* 5
define HASH_SIZE 113
define HASH_SIZE 113
define MAX_THREADS 64
define MAX_THREADS 64
define MSG_LEN 40
define NOPS 1000000 /\* 1M \*/
define NOPS 1000000 /\* 1M \*/
define NOPS 1000000 /\* 1M \*/
define NOPS 1000000 /\* 1M \*/
define NOPS 1000000 /\* 1M \*/
define NOPS 1000000 /\* 1M \*/
define NOPS 1000000 /\* 1M \*/
define NOPS 1000000 /\* 1M \*/
define NUM_THREADS 16
define PTHREAD_ABORT_AND_EXIT (code) /* multi line expression */
define RAND_BLOCKS 64
define RAND_BLOCK_SIZE 1000000
define RAND_SIZE [**RAND\_BLOCKS**](unittests__lf_8c.md#define-rand_blocks) \* [**RAND\_BLOCK\_SIZE**](unittests__lf_8c.md#define-rand_block_size)
define strlen (s1) (([**int**](broker__monitor_8c.md#function-timeout)) strlen([**s1**](broker__monitor_8c.md#function-timeout)))

Public Types Documentation

typedef XENTRY

typedef struct xentry XENTRY;

typedef my_hashmap

using my_hashmap =  lf_hash_table_cpp<int, xentry>;

typedef my_hashmap_iterator

using my_hashmap_iterator =  my_hashmap::iterator;

Public Static Attributes Documentation

variable del_op_count

int del_op_count;

variable random_numbers

int random_numbers[ 64 * 1000000];

variable start_time

struct timeval start_time;

variable xentry_desc

LF_ENTRY_DESCRIPTOR xentry_desc;

Public Functions Documentation

function main

int main (
    int argc,
    char ** argv
) 

function test_clear_proc_1

void * test_clear_proc_1 (
    void * param
) 

function test_clear_proc_2

void * test_clear_proc_2 (
    void * param
) 

function test_clear_proc_3

void * test_clear_proc_3 (
    void * param
) 

function test_freelist_proc

void * test_freelist_proc (
    void * param
) 

function test_freelist_proc_local_tran

void * test_freelist_proc_local_tran (
    void * param
) 

function test_hash_proc_1

void * test_hash_proc_1 (
    void * param
) 

function test_hash_proc_2

void * test_hash_proc_2 (
    void * param
) 

function test_hash_proc_3

void * test_hash_proc_3 (
    void * param
) 

Public Static Functions Documentation

function begin

static void begin (
    const  char * test_name
) 

function fail

static int fail (
    const  char * message
) 

function generate_random

static void generate_random () 

function success

static int success () 

function test_freelist

static int test_freelist (
    LF_ENTRY_DESCRIPTOR * edesc,
    int nthreads,
    bool test_local_tran
) 

function test_hash_iterator

static int test_hash_iterator () 

function test_hash_table

static int test_hash_table (
    LF_ENTRY_DESCRIPTOR * edesc,
    int nthreads,
    void *(*)( void *) proc
) 

function xentry_alloc

static void * xentry_alloc () 

function xentry_free

static int xentry_free (
    void * entry
) 

function xentry_hash

static unsigned  int xentry_hash (
    void * key,
    int htsize
) 

function xentry_init

static int xentry_init (
    void * entry
) 

function xentry_key_compare

static int xentry_key_compare (
    void * k1,
    void * k2
) 

function xentry_key_copy

static int xentry_key_copy (
    void * src,
    void * dest
) 

function xentry_uninit

static int xentry_uninit (
    void * entry
) 

Macro Definition Documentation

define HASH_POPULATION

#define HASH_POPULATION `HASH_SIZE * 5`

define HASH_SIZE

#define HASH_SIZE `113`

define HASH_SIZE

#define HASH_SIZE `113`

define MAX_THREADS

#define MAX_THREADS `64`

define MAX_THREADS

#define MAX_THREADS `64`

define MSG_LEN

#define MSG_LEN `40`

define NOPS

#define NOPS `1000000   /* 1M */`

define NOPS

#define NOPS `1000000   /* 1M */`

define NOPS

#define NOPS `1000000   /* 1M */`

define NOPS

#define NOPS `1000000   /* 1M */`

define NOPS

#define NOPS `1000000   /* 1M */`

define NOPS

#define NOPS `1000000   /* 1M */`

define NOPS

#define NOPS `1000000   /* 1M */`

define NOPS

#define NOPS `1000000   /* 1M */`

define NUM_THREADS

#define NUM_THREADS `16`

define PTHREAD_ABORT_AND_EXIT

#define PTHREAD_ABORT_AND_EXIT (
    code
) `/* multi line expression */`

define RAND_BLOCKS

#define RAND_BLOCKS `64`

define RAND_BLOCK_SIZE

#define RAND_BLOCK_SIZE `1000000`

define RAND_SIZE

#define RAND_SIZE `RAND_BLOCKS * RAND_BLOCK_SIZE`

define strlen

#define strlen (
    s1
) `(( int ) strlen( s1 ))`


The documentation for this class was generated from the following file cubrid/src/executables/unittests_lf.c