Changeset 57f70ab


Ignore:
Timestamp:
May 13, 2021, 3:47:26 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8cd5434
Parents:
a9172b5
Message:

New main now uses proper define.
+ tweak to loop count

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel.cfa

    ra9172b5 r57f70ab  
    182182                MAIN_LOOP:
    183183                for() {
    184                         #if 1
     184                        #define OLD_MAIN 1
     185                        #if OLD_MAIN
    185186                        // Check if there is pending io
    186187                        __maybe_io_drain( this );
     
    262263
    263264                        #else
    264 
     265                                #warning new kernel loop
    265266                        SEARCH: {
    266267                                /* paranoid */ verify( ! __preemption_enabled() );
     
    277278
    278279                                // Spin a little on I/O, just in case
    279                                 for(25) {
     280                                        for(5) {
    280281                                        __maybe_io_drain( this );
    281282                                        readyThread = pop_fast( this->cltr );
     
    284285
    285286                                // no luck, try stealing a few times
    286                                 for(25) {
     287                                        for(5) {
    287288                                        if( __maybe_io_drain( this ) ) {
    288289                                                readyThread = pop_fast( this->cltr );
     
    867868                unsigned tail = *ctx->cq.tail;
    868869                if(head == tail) return false;
     870                #if OLD_MAIN
    869871                ready_schedule_lock();
    870872                ret = __cfa_io_drain( proc );
    871873                ready_schedule_unlock();
     874                #else
     875                        ret = __cfa_io_drain( proc );
     876        #endif
    872877        #endif
    873878        return ret;
Note: See TracChangeset for help on using the changeset viewer.