Changes in / [ee163895:1057e3d]


Ignore:
Files:
6 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • src/tests/concurrent/coroutineYield.c

    ree163895 r1057e3d  
    44#include <thread>
    55#include <time>
    6 
    7 #include "long_tests.h"
    86
    97#ifndef PREEMPTION_RATE
     
    1513}
    1614
    17 #ifdef TEST_LONG
     15#ifdef LONG_TEST
    1816static const unsigned long N = 600_000ul;
    1917#else
     
    3533int main(int argc, char* argv[]) {
    3634        Coroutine c;
    37         for(int i = 0; TEST(i < N); i++) {
     35        for(int i = 0; i < N; i++) {
    3836                sout | "Thread 1" | endl;
    3937                resume(c);
    4038                sout | "Thread 2" | endl;
    4139                yield();
    42                 KICK_WATCHDOG;
    4340        }
    4441}
  • src/tests/concurrent/preempt.c

    ree163895 r1057e3d  
    22#include <thread>
    33#include <time>
    4 
    5 #include "long_tests.h"
    64
    75#ifndef PREEMPTION_RATE
     
    1311}
    1412
    15 #ifdef TEST_LONG
     13#ifdef LONG_TEST
    1614static const unsigned long N = 30_000ul;
    1715#else
     
    3230
    3331void main(worker_t & this) {
    34         while(TEST(counter < N)) {
     32        while(counter < N) {
    3533                __cfaabi_check_preemption();
    3634                if( (counter % 7) == this.value ) {
     
    4240                }
    4341                __cfaabi_check_preemption();
    44                 KICK_WATCHDOG;
    4542        }
    4643}
  • src/tests/concurrent/signal/block.c

    ree163895 r1057e3d  
    1414#include <time>
    1515
    16 #include "long_tests.h"
    17 
    1816#ifndef PREEMPTION_RATE
    1917#define PREEMPTION_RATE 10`ms
     
    2422}
    2523
    26 #ifdef TEST_LONG
     24#ifdef LONG_TEST
    2725static const unsigned long N = 150_000ul;
    2826#else
     
    6866thread Waiter {};
    6967void main( Waiter & this ) {
    70         for( int i = 0; TEST(i < N); i++ ) {
     68        for( int i = 0; i < N; i++ ) {
    7169                wait_op( globalA, globalB, i );
    72                 KICK_WATCHDOG;
    7370        }
    7471}
  • src/tests/concurrent/signal/disjoint.c

    ree163895 r1057e3d  
    44#include <thread>
    55#include <time>
    6 
    7 #include "long_tests.h"
    86
    97#ifndef PREEMPTION_RATE
     
    1513}
    1614
    17 #ifdef TEST_LONG
     15#ifdef LONG_TEST
    1816static const unsigned long N = 300_000ul;
    1917#else
     
    7371        if( (d.counter % 1000) == 0 ) sout | d.counter | endl;
    7472
    75         return TEST(d.counter < N);
     73        return d.counter < N;
    7674}
    7775
     
    7977
    8078void main( Waiter & this ) {
    81         while( wait( mut, data ) ) { KICK_WATCHDOG; yield(); }
     79        while( wait( mut, data ) ) { yield(); }
    8280}
    8381
     
    9694
    9795        //This is technically a mutual exclusion violation but the mutex monitor protects us
    98         bool running = TEST(data.counter < N) && data.counter > 0;
     96        bool running = data.counter < N && data.counter > 0;
    9997        if( data.state != SIGNAL && running ) {
    10098                sout | "ERROR Eager signal" | data.state | endl;
  • src/tests/concurrent/signal/wait.c

    ree163895 r1057e3d  
    1212#include <time>
    1313
    14 #include "long_tests.h"
    15 
    1614#ifndef PREEMPTION_RATE
    1715#define PREEMPTION_RATE 10`ms
     
    2220}
    2321
    24 #ifdef TEST_LONG
     22#ifdef LONG_TEST
    2523static const unsigned long N = 375_000ul;
    2624#else
     
    9290// Waiter ABC
    9391void main( WaiterABC & this ) {
    94         for( int i = 0; TEST(i < N); i++ ) {
     92        for( int i = 0; i < N; i++ ) {
    9593                wait( condABC, globalA, globalB, globalC );
    96                 KICK_WATCHDOG;
    9794        }
    9895
     
    103100// Waiter AB
    104101void main( WaiterAB & this ) {
    105         for( int i = 0; TEST(i < N); i++ ) {
     102        for( int i = 0; i < N; i++ ) {
    106103                wait( condAB , globalA, globalB );
    107                 KICK_WATCHDOG;
    108104        }
    109105
     
    114110// Waiter AC
    115111void main( WaiterAC & this ) {
    116         for( int i = 0; TEST(i < N); i++ ) {
     112        for( int i = 0; i < N; i++ ) {
    117113                wait( condAC , globalA, globalC );
    118                 KICK_WATCHDOG;
    119114        }
    120115
     
    125120// Waiter BC
    126121void main( WaiterBC & this ) {
    127         for( int i = 0; TEST(i < N); i++ ) {
     122        for( int i = 0; i < N; i++ ) {
    128123                wait( condBC , globalB, globalC );
    129                 KICK_WATCHDOG;
    130124        }
    131125
  • src/tests/preempt_longrun/Makefile.am

    ree163895 r1057e3d  
    1919preempt=10ul\`ms
    2020debug=-debug
    21 type=LONG
    2221
    2322REPEAT = ${abs_top_srcdir}/tools/repeat
    24 WATCHDOG = ${abs_top_srcdir}/tools/watchdog
    2523TIME = /usr/bin/time -f "%E"
    2624
    27 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell echo $(type) | tr a-z A-Z)
     25BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -DLONG_TEST
    2826CFLAGS = ${BUILD_FLAGS}
    2927CC = @CFA_BINDIR@/@CFA_NAME@
     
    3129TESTS = block coroutine create disjoint enter enter3 processor stack wait yield
    3230
    33 # .INTERMEDIATE: ${TESTS}
     31.INTERMEDIATE: ${TESTS}
    3432
    3533all-local: ${TESTS:=.run}
    36 
    37 runall : ${TESTS:=.run}
    38         @ echo "All programs terminated normally"
    39 
    40 watchall : ${TESTS:=.watch}
    41         @ echo "All programs terminated normally"
    42 
    43 compileall : ${TESTS}
    44         @ echo "Compiled"
    4534
    4635clean-local:
     
    5544        @ echo -e "${<}: SUCCESS\n"
    5645
    57 %.watch : % ${WATCHDOG}
    58         @ time ${WATCHDOG} ./${<}
    59         @ rm ${<}
    60         @ echo -e "${<}: SUCCESS\n"
    61 
    6246%.time : % ${REPEAT}
    6347        @ ${REPEAT} -i -s -- $(repeats) $(TIME) -a -o times.log ./${<}
     
    6549        @ echo -e "${<}: SUCCESS\n"
    6650
    67 ${REPEAT}: ${abs_top_srcdir}/tools/Makefile
     51${REPEAT}:
    6852        @+make -C ${abs_top_srcdir}/tools/
    69 
    70 ${WATCHDOG}: ${abs_top_srcdir}/tools/Makefile
    71         @+make -C ${abs_top_srcdir}/tools/
  • src/tests/preempt_longrun/Makefile.in

    ree163895 r1057e3d  
    452452preempt = 10ul\`ms
    453453debug = -debug
    454 type = LONG
    455454REPEAT = ${abs_top_srcdir}/tools/repeat
    456 WATCHDOG = ${abs_top_srcdir}/tools/watchdog
    457455TIME = /usr/bin/time -f "%E"
    458 BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -I.. -I. -DTEST_$(shell echo $(type) | tr a-z A-Z)
     456BUILD_FLAGS = -g -Wall -Wno-unused-function -quiet @CFA_FLAGS@ -O2 -DPREEMPTION_RATE=${preempt} -DLONG_TEST
    459457TESTS = block coroutine create disjoint enter enter3 processor stack wait yield
    460458all: all-am
     
    875873
    876874
    877 # .INTERMEDIATE: ${TESTS}
     875.INTERMEDIATE: ${TESTS}
    878876
    879877all-local: ${TESTS:=.run}
    880 
    881 runall : ${TESTS:=.run}
    882         @ echo "All programs terminated normally"
    883 
    884 watchall : ${TESTS:=.watch}
    885         @ echo "All programs terminated normally"
    886 
    887 compileall : ${TESTS}
    888         @ echo "Compiled"
    889878
    890879clean-local:
     
    899888        @ echo -e "${<}: SUCCESS\n"
    900889
    901 %.watch : % ${WATCHDOG}
    902         @ time ${WATCHDOG} ./${<}
    903         @ rm ${<}
    904         @ echo -e "${<}: SUCCESS\n"
    905 
    906890%.time : % ${REPEAT}
    907891        @ ${REPEAT} -i -s -- $(repeats) $(TIME) -a -o times.log ./${<}
     
    909893        @ echo -e "${<}: SUCCESS\n"
    910894
    911 ${REPEAT}: ${abs_top_srcdir}/tools/Makefile
    912         @+make -C ${abs_top_srcdir}/tools/
    913 
    914 ${WATCHDOG}: ${abs_top_srcdir}/tools/Makefile
     895${REPEAT}:
    915896        @+make -C ${abs_top_srcdir}/tools/
    916897
  • src/tests/preempt_longrun/create.c

    ree163895 r1057e3d  
    22#include <thread>
    33#include <time>
    4 
    5 #include "long_tests.h"
    64
    75#ifndef PREEMPTION_RATE
     
    2119int main(int argc, char* argv[]) {
    2220        processor p;
    23         for(int i = 0; TEST(i < N); i++) {
     21        for(int i = 0; i < N; i++) {
    2422                worker_t w[7];
    25                 KICK_WATCHDOG;
    2623        }
    2724}
  • src/tests/preempt_longrun/enter.c

    ree163895 r1057e3d  
    33#include <thread>
    44#include <time>
    5 
    6 #include "long_tests.h"
    75
    86#ifndef PREEMPTION_RATE
     
    1715
    1816monitor mon_t {};
    19 void foo( mon_t & mutex this ) {
    20         KICK_WATCHDOG;
    21 }
     17void foo( mon_t & mutex this ) {}
    2218
    2319mon_t mon;
    2420thread worker_t {};
    2521void main( worker_t & this ) {
    26         for( unsigned long i = 0; TEST(i < N); i++ ) {
     22        for( unsigned long i = 0; i < N; i++ ) {
    2723                foo( mon );
    2824        }
  • src/tests/preempt_longrun/enter3.c

    ree163895 r1057e3d  
    33#include <thread>
    44#include <time>
    5 
    6 #include "long_tests.h"
    75
    86#ifndef PREEMPTION_RATE
     
    2018mon_t mon1, mon2, mon3;
    2119
    22 void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) {
    23         KICK_WATCHDOG;
    24 }
     20void foo( mon_t & mutex a, mon_t & mutex b, mon_t & mutex c ) {}
    2521
    2622thread worker_t {};
    2723
    2824void main( worker_t & this ) {
    29         for( unsigned long i = 0; TEST(i < N); i++ ) {
     25        for( unsigned long i = 0; i < N; i++ ) {
    3026                foo( mon1, mon2, mon3 );
    3127        }
  • src/tests/preempt_longrun/processor.c

    ree163895 r1057e3d  
    44
    55#include <unistd.h>
    6 
    7 #include "long_tests.h"
    86
    97#ifndef PREEMPTION_RATE
     
    1917int main(int argc, char* argv[]) {
    2018        processor * p[15];
     19        write(STDOUT_FILENO, "Preparing\n", sizeof("Preparing\n"));
    2120        for ( int pi = 0; pi < 15; pi++ ) {
    2221                p[pi] = new();
    2322        }
    24         for ( int i = 0; TEST(i < N); i++) {
     23        write(STDOUT_FILENO, "Starting\n", sizeof("Starting\n"));
     24        for ( int i = 0; i < N; i++) {
    2525                int pi = i % 15;
    2626                delete( p[pi] );
    2727                p[pi] = new();
    28                 KICK_WATCHDOG;
    2928        }
     29        write(STDOUT_FILENO, "Stopping\n", sizeof("Stopping\n"));
    3030        for ( int pi = 0; pi < 15; pi++ ) {
    3131                delete( p[pi] );
    3232        }
     33        write(STDOUT_FILENO, "Done\n", sizeof("Done\n"));
    3334}
  • src/tests/preempt_longrun/stack.c

    ree163895 r1057e3d  
    33#include <thread>
    44#include <time>
    5 
    6 #include "long_tests.h"
    75
    86#ifndef PREEMPTION_RATE
     
    2018        volatile long long a = 326_417ul;
    2119        volatile long long n = 1l;
    22         for (volatile long long i = 0; TEST(i < p); i++) {
     20        for (volatile long long i = 0; i < p; i++) {
    2321                n *= a;
    2422                n %= p;
    25                 KICK_WATCHDOG;
    2623        }
    2724
    28         if( !TEST(n == a) ) {
     25        if( n != a ) {
    2926                abort();
    3027        }
  • src/tests/preempt_longrun/yield.c

    ree163895 r1057e3d  
    22#include <thread>
    33#include <time>
    4 
    5 #include "long_tests.h"
    64
    75#ifndef PREEMPTION_RATE
     
    1311}
    1412
    15 #ifdef TEST_LONG
     13#ifdef LONG_TEST
    1614static const unsigned long N = 9_750_000ul;
    1715#else
     
    2220
    2321void main(worker_t & this) {
    24         for(int i = 0; TEST(i < N); i++) {
     22        for(int i = 0; i < N; i++) {
    2523                yield();
    26                 KICK_WATCHDOG;
    2724        }
    2825}
  • tools/Makefile.am

    ree163895 r1057e3d  
    1818CFLAGS = -Wall -Wextra -O2 -g
    1919
    20 noinst_PROGRAMS = busy catchsig repeat watchdog
     20noinst_PROGRAMS = busy catchsig repeat
    2121
    2222busy_SOURCES     = busy.c
     
    2424catchsig_SOURCES = catchsig.c
    2525repeat_SOURCES   = repeat.c
    26 watchdog_SOURCES = watchdog.c
  • tools/Makefile.in

    ree163895 r1057e3d  
    9292build_triplet = @build@
    9393host_triplet = @host@
    94 noinst_PROGRAMS = busy$(EXEEXT) catchsig$(EXEEXT) repeat$(EXEEXT) \
    95         watchdog$(EXEEXT)
     94noinst_PROGRAMS = busy$(EXEEXT) catchsig$(EXEEXT) repeat$(EXEEXT)
    9695subdir = tools
    9796ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    116115repeat_OBJECTS = $(am_repeat_OBJECTS)
    117116repeat_LDADD = $(LDADD)
    118 am_watchdog_OBJECTS = watchdog.$(OBJEXT)
    119 watchdog_OBJECTS = $(am_watchdog_OBJECTS)
    120 watchdog_LDADD = $(LDADD)
    121117AM_V_P = $(am__v_P_@AM_V@)
    122118am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
     
    147143am__v_CCLD_0 = @echo "  CCLD    " $@;
    148144am__v_CCLD_1 =
    149 SOURCES = $(busy_SOURCES) $(catchsig_SOURCES) $(repeat_SOURCES) \
    150         $(watchdog_SOURCES)
    151 DIST_SOURCES = $(busy_SOURCES) $(catchsig_SOURCES) $(repeat_SOURCES) \
    152         $(watchdog_SOURCES)
     145SOURCES = $(busy_SOURCES) $(catchsig_SOURCES) $(repeat_SOURCES)
     146DIST_SOURCES = $(busy_SOURCES) $(catchsig_SOURCES) $(repeat_SOURCES)
    153147am__can_run_installinfo = \
    154148  case $$AM_UPDATE_INFO_DIR in \
     
    301295catchsig_SOURCES = catchsig.c
    302296repeat_SOURCES = repeat.c
    303 watchdog_SOURCES = watchdog.c
    304297all: all-am
    305298
     
    351344        $(AM_V_CCLD)$(LINK) $(repeat_OBJECTS) $(repeat_LDADD) $(LIBS)
    352345
    353 watchdog$(EXEEXT): $(watchdog_OBJECTS) $(watchdog_DEPENDENCIES) $(EXTRA_watchdog_DEPENDENCIES)
    354         @rm -f watchdog$(EXEEXT)
    355         $(AM_V_CCLD)$(LINK) $(watchdog_OBJECTS) $(watchdog_LDADD) $(LIBS)
    356 
    357346mostlyclean-compile:
    358347        -rm -f *.$(OBJEXT)
     
    364353@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/catchsig.Po@am__quote@
    365354@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repeat.Po@am__quote@
    366 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watchdog.Po@am__quote@
    367355
    368356.c.o:
Note: See TracChangeset for help on using the changeset viewer.