Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Functions | Variables
atomic_xchg.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_xchg.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 intT >
intT exchange (intT &x, intT y)
 
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 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 235 of file atomic_xchg.cpp.

Function Documentation

◆ exchange()

template<class intT >
intT exchange ( intT &  x,
intT  y 
)

Definition at line 88 of file atomic_xchg.cpp.

◆ main()

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

Definition at line 358 of file atomic_xchg.cpp.

◆ run_test()

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

Definition at line 239 of file atomic_xchg.cpp.

◆ thread_routine() [1/2]

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

Definition at line 108 of file atomic_xchg.cpp.

◆ thread_routine() [2/2]

void * thread_routine ( void *  arg)

Definition at line 186 of file atomic_xchg.cpp.

Variable Documentation

◆ rw_opt_nloops

int rw_opt_nloops = 1024 * 1024

Definition at line 232 of file atomic_xchg.cpp.

◆ rw_opt_nthreads

int rw_opt_nthreads = 4

Definition at line 233 of file atomic_xchg.cpp.