Changeset 6a490b2 for tests/concurrent


Ignore:
Timestamp:
May 11, 2020, 1:53:29 PM (17 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
504a7dc
Parents:
b7d6a36 (diff), a7b486b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into relaxed_ready

Location:
tests/concurrent
Files:
5 added
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • tests/concurrent/.expect/monitor.txt

    rb7d6a36 r6a490b2  
    1 4000000
     13000000
  • tests/concurrent/coroutineYield.cfa

    rb7d6a36 r6a490b2  
    3333                        sout | "Coroutine 2";
    3434                #endif
    35                 suspend();
     35                suspend;
    3636        }
    3737}
  • tests/concurrent/monitor.cfa

    rb7d6a36 r6a490b2  
    2929
    3030void main( MyThread & this ) {
    31         for(int i = 0; i < 1_000_000; i++) {
     31        for(int i = 0; i < 750_000; i++) {
    3232                increment( global );
    3333        }
  • tests/concurrent/multi-monitor.cfa

    rb7d6a36 r6a490b2  
    1111
    1212void increment( monitor_t & mutex p1, monitor_t & mutex p2, int & value ) {
     13        assert(active_thread() == get_monitor(p1)->owner);
     14        assert(active_thread() == get_monitor(p2)->owner);
    1315        value += 1;
     16        assert(active_thread() == get_monitor(p1)->owner);
     17        assert(active_thread() == get_monitor(p2)->owner);
    1418}
    1519
  • tests/concurrent/signal/block.cfa

    rb7d6a36 r6a490b2  
    3333
    3434monitor global_data_t {
    35         thread_desc * last_thread;
    36         thread_desc * last_signaller;
     35        $thread * last_thread;
     36        $thread * last_signaller;
    3737};
    3838
     
    8282        if( !is_empty( cond ) ) {
    8383
    84                 thread_desc * next = front( cond );
     84                $thread * next = front( cond );
    8585
    8686                if( ! signal_block( cond ) ) {
  • tests/concurrent/suspend_then.cfa

    rb7d6a36 r6a490b2  
    11#include <fstream.hfa>
    22#include <kernel.hfa>
    3 #include <monitor.hfa>
    43#include <thread.hfa>
    54#include <time.hfa>
     
    109#include "long_tests.hfa"
    1110
    12 #ifndef PREEMPTION_RATE
    13 #define PREEMPTION_RATE 10`ms
    14 #endif
    15 
    1611Duration default_preemption() {
    17         return PREEMPTION_RATE;
     12        return 0;
    1813}
    1914
     
    2621#if !defined(TEST_FOREVER)
    2722        static inline void print(const char * const text ) {
    28                 write( STDERR_FILENO, text, strlen(text) );
     23                write( STDOUT_FILENO, text, strlen(text) );
    2924        }
    3025#else
     
    3227#endif
    3328
    34 coroutine Coroutine {};
     29generator Coroutine { int i; };
    3530
    3631volatile bool done = false;
     
    4944
    5045void main(Coroutine& this) {
    51         suspend();
    52         for(int i = 0; TEST(i < N); i++) {
     46        this.i = 0;
     47        suspend;
     48        for(;TEST(this.i < N); this.i++) {
    5349
    54                 print("C - Suspending");
    55                 void publish() {
    56                         print("C - Publishing");
     50                print("C - Suspending\n");
     51                suspend{
     52                        print("C - Publishing\n");
    5753                        assert(!the_cor);
    5854                        store( this );
    5955                }
    60                 suspend_then(publish);
    6156                assert(!the_cor);
    62                 print("Coroutine 2");
     57                print("C - Back\n");
    6358                KICK_WATCHDOG;
    6459                yield();
    6560        }
    6661        done = true;
    67         suspend();
     62        suspend;
    6863}
    6964
     
    7772                if(!mine) continue;
    7873
    79                 print("T - took");
     74                print("T - took\n");
    8075                resume(*mine);
    81                 print("T - back");
    8276        }
    8377}
Note: See TracChangeset for help on using the changeset viewer.