Changeset cd99ef1


Ignore:
Timestamp:
Jul 19, 2017, 12:33:20 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
8b28a52
Parents:
3175147
Message:

Clean-up longrunning tests to be more consistent

Location:
src/tests
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • src/tests/preempt_longrun/create.c

    r3175147 rcd99ef1  
    11#include <kernel>
    22#include <thread>
     3
     4static const unsigned long N = 2_000ul;
    35
    46#ifndef PREEMPTION_RATE
     
    1618int main(int argc, char* argv[]) {
    1719        processor p;
    18         for(int i = 0; i < 10_000ul; i++) {
     20        for(int i = 0; i < N; i++) {
    1921                worker_t w[7];
    2022        }
  • src/tests/preempt_longrun/enter.c

    r3175147 rcd99ef1  
    33#include <thread>
    44
    5 #undef N
    65static const unsigned long N  = 70_000ul;
    76
  • src/tests/preempt_longrun/enter3.c

    r3175147 rcd99ef1  
    33#include <thread>
    44
    5 #undef N
    65static const unsigned long N  = 50_000ul;
    76
  • src/tests/preempt_longrun/processor.c

    r3175147 rcd99ef1  
    11#include <kernel>
    22#include <thread>
     3
     4static const unsigned long N = 5_000ul;
    35
    46#ifndef PREEMPTION_RATE
     
    1517
    1618int main(int argc, char* argv[]) {
    17         for(int i = 0; i < 10_000ul; i++) {
     19        for(int i = 0; i < N; i++) {
    1820                processor p;
    1921        }
  • src/tests/preempt_longrun/yield.c

    r3175147 rcd99ef1  
    11#include <kernel>
    22#include <thread>
     3
     4static const unsigned long N = 325_000ul;
    35
    46#ifndef PREEMPTION_RATE
     
    1315
    1416void main(worker_t * this) {
    15         for(int i = 0; i < 325_000ul; i++) {
     17        for(int i = 0; i < N; i++) {
    1618                yield();
    1719        }
  • src/tests/sched-int-barge.c

    r3175147 rcd99ef1  
    55#include <thread>
    66
    7 #ifndef N
    8 #define N 100_000
     7static const unsigned long N = 50_000ul;
     8
     9#ifndef PREEMPTION_RATE
     10#define PREEMPTION_RATE 10_000ul
    911#endif
    1012
     13unsigned int default_preemption() {
     14        return 0;
     15}
    1116enum state_t { WAIT, SIGNAL, BARGE };
    1217
     
    1419
    1520monitor global_data_t {
    16         bool done;
     21        volatile bool done;
    1722        int counter;
    1823        state_t state;
     
    5560                c->do_wait2 = ((unsigned)rand48()) % (c->do_signal);
    5661
    57                 // if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;
     62                if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;
    5863        }
    5964
     
    9398}
    9499
     100static thread_desc * volatile the_threads;
     101
    95102int main(int argc, char* argv[]) {
    96         rand48seed(0);
    97         processor p;
    98         {
    99                 Threads t[17];
    100         }
     103        rand48seed(0);
     104        processor p;
     105        {
     106                Threads t[17];
     107                the_threads = (thread_desc*)t;
     108        }
    101109}
  • src/tests/sched-int-block.c

    r3175147 rcd99ef1  
    55#include <thread>
    66
    7 #ifndef N
    8 #define N 10_000
     7#include <time.h>
     8
     9static const unsigned long N = 5_000ul;
     10
     11#ifndef PREEMPTION_RATE
     12#define PREEMPTION_RATE 10_000ul
    913#endif
     14
     15unsigned int default_preemption() {
     16        return PREEMPTION_RATE;
     17}
    1018
    1119enum state_t { WAITED, SIGNAL, BARGE };
     
    101109
    102110int main(int argc, char* argv[]) {
    103         rand48seed(0);
     111        rand48seed( time( NULL ) );
    104112        done = false;
    105113        processor p;
  • src/tests/sched-int-disjoint.c

    r3175147 rcd99ef1  
    44#include <thread>
    55
    6 #ifndef N
    7 #define N 10_000
     6static const unsigned long N = 10_000ul;
     7
     8#ifndef PREEMPTION_RATE
     9#define PREEMPTION_RATE 10_000ul
    810#endif
     11
     12unsigned int default_preemption() {
     13        return PREEMPTION_RATE;
     14}
    915
    1016enum state_t { WAIT, SIGNAL, BARGE };
  • src/tests/sched-int-wait.c

    r3175147 rcd99ef1  
    55#include <thread>
    66
    7 #ifndef N
    8 #define N 10_000
     7static const unsigned long N = 10_000ul;
     8
     9#ifndef PREEMPTION_RATE
     10#define PREEMPTION_RATE 10_000ul
    911#endif
     12
     13unsigned int default_preemption() {
     14        return PREEMPTION_RATE;
     15}
    1016
    1117monitor global_t {};
     
    114120int main(int argc, char* argv[]) {
    115121        waiter_left = 4;
    116         processor p;
     122        processor p[2];
    117123        sout | "Starting" | endl;
    118124        {
Note: See TracChangeset for help on using the changeset viewer.