Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Functions | Variables
atomic_add.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <rw/_mutex.h>
#include <rw_any.h>
#include <rw_cmdopt.h>
#include <rw_driver.h>
#include <rw_thread.h>
Include dependency graph for atomic_add.cpp:

Go to the source code of this file.

Data Structures

struct  thr_args_base
 
struct  thr_args< intT >
 

Macros

#define MAX_THREADS   32
 

Functions

template<class T >
T preincrement (T &x)
 
template<class T >
T predecrement (T &x)
 
template<class intT >
void * thread_routine (thr_args< intT > *args)
 
void * thread_routine (void *arg)
 
template<class intT >
void run_test (intT, thr_args_base::tag_t tag, int inc)
 
int main (int argc, char *argv[])
 

Variables

int rw_opt_nloops = 1024 * 1024
 
int rw_opt_nthreads = 4
 

Macro Definition Documentation

◆ MAX_THREADS

#define MAX_THREADS   32

Definition at line 212 of file atomic_add.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 371 of file atomic_add.cpp.

◆ predecrement()

template<class T >
T predecrement ( T &  x)

Definition at line 105 of file atomic_add.cpp.

◆ preincrement()

template<class T >
T preincrement ( T &  x)

Definition at line 90 of file atomic_add.cpp.

◆ run_test()

template<class intT >
void run_test ( intT  ,
thr_args_base::tag_t  tag,
int  inc 
)

Definition at line 216 of file atomic_add.cpp.

◆ thread_routine() [1/2]

template<class intT >
void * thread_routine ( thr_args< intT > *  args)

Definition at line 122 of file atomic_add.cpp.

◆ thread_routine() [2/2]

void * thread_routine ( void *  arg)

Definition at line 165 of file atomic_add.cpp.

Variable Documentation

◆ rw_opt_nloops

int rw_opt_nloops = 1024 * 1024

Definition at line 209 of file atomic_add.cpp.

◆ rw_opt_nthreads

int rw_opt_nthreads = 4

Definition at line 210 of file atomic_add.cpp.