source: benchmark/creation/qthreads.c @ 70a141d4

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 70a141d4 was fe065c3, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago

new CFA generator and qthreads tests

  • Property mode set to 100644
File size: 765 bytes
Line 
1#include <stdio.h>
2#include <stdlib.h>
3#include <assert.h>
4#include <unistd.h>
5#include <qthread.h>
6
7#include "bench.h"
8
9static aligned_t greeter( void * arg ) {
10        return 0;
11}
12
13int main( int argc, char *argv[] ) {
14        aligned_t return_value = 0;
15        int status;
16
17        status = qthread_init( 1 );
18        assert(status == QTHREAD_SUCCESS);
19
20        BENCH(
21                for ( size_t i = 0; i < n; i += 1 ) {
22                        qthread_fork( greeter, NULL, &return_value );
23                        qthread_readFF( NULL, &return_value );
24                }, result
25        )
26        printf( "%g\n", result );
27
28        return EXIT_SUCCESS;
29}
30
31// Local Variables: //
32// tab-width: 4 //
33// compile-command: "gcc -g -O2 -Wall -I.. -I/u/pabuhr/software/qthreads/include -L/u/pabuhr/software/qthreads/lib -Xlinker -R/u/pabuhr/software/qthreads/lib qthreads.c -lqthread" //
34// End: //
Note: See TracBrowser for help on using the repository browser.