#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <assert.h>
#include <err.h>
#include <poll.h>
#include <sys/time.h>
#include <string.h>
#include <pthread.h>
#include "threadpool.h"
Go to the source code of this file.
#define ATOMIC_BOOL_COMPARE_AND_SWAP |
( |
|
PTR, |
|
|
|
OLD, |
|
|
|
NEW |
|
) |
| (__sync_bool_compare_and_swap(PTR, OLD, NEW)) |
#define SPIN_ADJ |
( |
|
F, |
|
|
|
ADJ |
|
) |
| |
Value:do { \
for (;;) { \
size_t v = F; \
break; \
} \
} \
} while (0)
#define ATOMIC_BOOL_COMPARE_AND_SWAP(PTR, OLD, NEW)
Definition at line 48 of file test_threadpool_sequencing.c.
static void dump_stats |
( |
const char * |
prefix, |
|
|
struct threadpool_info * |
stats, |
|
|
size_t |
ticks |
|
) |
| |
|
static |
static void task_cb |
( |
void * |
udata | ) |
|
|
static |
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 84 of file test_threadpool_sequencing.c.
References completed_count, dump_stats(), limit, MAX_TASKS, threadpool_config::max_threads, threadpool_task::task, task_cb(), threadpool_config::task_ringbuf_size2, Threadpool_Init(), Threadpool_Schedule(), and Threadpool_Stats().
size_t completed_count = 0 |
|
static |