My Project: dynamics.mod/NewtonDynamics/source/pthreads.2/tests/benchtest2.c File Reference

My Project

Macros | Functions | Variables
benchtest2.c File Reference
`#include "test.h"`
`#include <sys/timeb.h>`
`#include "benchtest.h"`

## Macros

#define | PTW32_MUTEX_TYPES
#define | ITERATIONS 100000L
#define | GetDurationMilliSecs(_TStart, _TStop)
#define | TESTSTART { int i, j = 0, k = 0; PTW32_FTIME(&currSysTimeStart); for (i = 0; i < ITERATIONS; i++) { j++;
#define | TESTSTOP }; PTW32_FTIME(&currSysTimeStop); if (j + k == i) j++; }

## Functions

void * | overheadThread (void *arg)
void * | oldThread (void *arg)
void * | workerThread (void *arg)
void * | CSThread (void *arg)
void | runTest (char *testNameString, int mType)
int | main (int argc, char *argv[])

## Variables

pthread_mutex_t | gate1
pthread_mutex_t | gate2
old_mutex_t | ox1
old_mutex_t | ox2
CRITICAL_SECTION | cs1
CRITICAL_SECTION | cs2
pthread_mutexattr_t | ma
long | durationMilliSecs
long | overHeadMilliSecs = 0
PTW32_STRUCT_TIMEB | currSysTimeStart
PTW32_STRUCT_TIMEB | currSysTimeStop
pthread_t | worker
int | running = 0

## Macro Definition Documentation

## § GetDurationMilliSecs

#define GetDurationMilliSecs | ( |  | _TStart,
|  |  | _TStop
| ) |  |

Value:
((long)((_TStop.time*1000+_TStop.millitm) \
- (_TStart.time*1000+_TStart.millitm)))

## § ITERATIONS

#define ITERATIONS 100000L

## § PTW32_MUTEX_TYPES

#define PTW32_MUTEX_TYPES

## § TESTSTART

#define TESTSTART { int i, j = 0, k = 0; PTW32_FTIME(&currSysTimeStart); for (i = 0; i < ITERATIONS; i++) { j++;

## § TESTSTOP

#define TESTSTOP }; PTW32_FTIME(&currSysTimeStop); if (j + k == i) j++; }

## Function Documentation

## § CSThread()

void* CSThread | ( | void * | arg | ) |

## § main()

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

## § oldThread()

void* oldThread | ( | void * | arg | ) |

## § overheadThread()

void* overheadThread | ( | void * | arg | ) |

## § runTest()

void runTest | ( | char * | testNameString,
|  | int | mType
| ) |  |

## § workerThread()

void* workerThread | ( | void * | arg | ) |

## Variable Documentation

## § cs1

CRITICAL_SECTION cs1

## § cs2

CRITICAL_SECTION cs2

## § currSysTimeStart

PTW32_STRUCT_TIMEB currSysTimeStart

## § currSysTimeStop

PTW32_STRUCT_TIMEB currSysTimeStop

## § durationMilliSecs

long durationMilliSecs

## § gate1

pthread_mutex_t gate1

## § gate2

pthread_mutex_t gate2

## § ma

pthread_mutexattr_t ma

## § overHeadMilliSecs

long overHeadMilliSecs = 0

## § ox1

old_mutex_t ox1

## § ox2

old_mutex_t ox2

## § running

int running = 0

## § worker

pthread_t worker