Motr  M0
thread_pool.c File Reference
#include "ut/ut.h"
#include "lib/errno.h"
#include "lib/tlist.h"
#include "lib/atomic.h"
#include "lib/thread_pool.h"
Include dependency graph for thread_pool.c:

Go to the source code of this file.

Data Structures

struct  tpool_test
 

Functions

 M0_TL_DESCR_DEFINE (tpt, "tpt-s", static, struct tpool_test, t_linkage, t_magic, 0x1111111111111111, 0x1111111111111111)
 
 M0_TL_DEFINE (tpt, static, struct tpool_test)
 
static int thread_pool_process (void *item)
 
static void thread_pool_init (struct m0_parallel_pool *pool)
 
static void small_thread_pool_init (struct m0_parallel_pool *pool)
 
static void thread_pool_fini (struct m0_parallel_pool *pool)
 
static void feed (struct m0_parallel_pool *pool, bool err_test)
 
static void simple_thread_pool_test (struct m0_parallel_pool *pool)
 
static void parallel_for_pool_test (struct m0_parallel_pool *pool)
 
static void simple_thread_pool_error_test (struct m0_parallel_pool *pool)
 
void m0_ut_lib_thread_pool_test (void)
 

Variables

static const int ROUNDS_NR = 200
 
static const int THREAD_NR = 10
 
static const int QLINKS_NR = 10
 
static uint64_t test_counts = 0
 
static struct m0_atomic64 counts
 
struct tpool_test test []
 
struct tpool_test error_test []
 

Function Documentation

◆ feed()

static void feed ( struct m0_parallel_pool pool,
bool  err_test 
)
static

Definition at line 88 of file thread_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ M0_TL_DEFINE()

M0_TL_DEFINE ( tpt  ,
static  ,
struct tpool_test   
)

◆ M0_TL_DESCR_DEFINE()

M0_TL_DESCR_DEFINE ( tpt  ,
"tpt-s ,
static  ,
struct tpool_test  ,
t_linkage  ,
t_magic  ,
0x1111111111111111  ,
0x1111111111111111   
)

◆ m0_ut_lib_thread_pool_test()

void m0_ut_lib_thread_pool_test ( void  )

Definition at line 166 of file thread_pool.c.

Here is the call graph for this function:

◆ parallel_for_pool_test()

static void parallel_for_pool_test ( struct m0_parallel_pool pool)
static

Definition at line 119 of file thread_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ simple_thread_pool_error_test()

static void simple_thread_pool_error_test ( struct m0_parallel_pool pool)
static

Definition at line 146 of file thread_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ simple_thread_pool_test()

static void simple_thread_pool_test ( struct m0_parallel_pool pool)
static

Definition at line 104 of file thread_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ small_thread_pool_init()

static void small_thread_pool_init ( struct m0_parallel_pool pool)
static

Definition at line 74 of file thread_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thread_pool_fini()

static void thread_pool_fini ( struct m0_parallel_pool pool)
static

Definition at line 82 of file thread_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thread_pool_init()

static void thread_pool_init ( struct m0_parallel_pool pool)
static

Definition at line 66 of file thread_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thread_pool_process()

static int thread_pool_process ( void *  item)
static

Definition at line 56 of file thread_pool.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ counts

struct m0_atomic64 counts
static

Definition at line 34 of file thread_pool.c.

◆ error_test

struct tpool_test error_test[]
Initial value:
= {
{ .t_count = 1 }, { .t_count = 2, .t_rc = -EINTR, },
{ .t_count = 3 }, { .t_count = 4, .t_rc = -ENOMEM, },
{ .t_count = 5 }, { .t_count = 6, .t_rc = -E2BIG, },
{ .t_count = 7 }, { .t_count = 8, .t_rc = -EINTR, },
}

Definition at line 49 of file thread_pool.c.

◆ QLINKS_NR

const int QLINKS_NR = 10
static

Definition at line 31 of file thread_pool.c.

◆ ROUNDS_NR

const int ROUNDS_NR = 200
static

Definition at line 29 of file thread_pool.c.

◆ test_counts

uint64_t test_counts = 0
static

Definition at line 33 of file thread_pool.c.

◆ THREAD_NR

const int THREAD_NR = 10
static

Definition at line 30 of file thread_pool.c.