Ignore:
Timestamp:
Jun 19, 2020, 4:59:19 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0f89d4f
Parents:
64a7146
Message:

Added Idle Sleep stats and removed extra call to unsafe_remove

File:
1 edited

Legend:

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

    r64a7146 r68f36f4  
    371371
    372372                        // Make sure we aren't on the idle queue
     373                        #if !defined(__CFA_NO_STATISTICS__)
     374                                bool removed =
     375                        #endif
    373376                        unsafe_remove( this->cltr->idles, this );
    374                         Link(processor) * link = &this->cltr->idles.stack;
    375                         for() {
    376                                 processor * next = link->top;
    377                                 if( next == this ) {
    378                                         link->top = getNext(this)->top;
    379                                         break;
    380                                 }
    381                                 if( next == 0p ) break;
    382                                 link = getNext(next);
    383                         }
     377
     378                        #if !defined(__CFA_NO_STATISTICS__)
     379                                if(removed) __tls_stats()->ready.sleep.exits++;
     380                        #endif
    384381
    385382                // Unlock the RWlock
     
    672669                push( thrd->curr_cluster, thrd );
    673670
    674                 __wake_one(id, thrd->curr_cluster);
     671                #if !defined(__CFA_NO_STATISTICS__)
     672                        bool woke =
     673                #endif
     674                        __wake_one(id, thrd->curr_cluster);
     675
     676                #if !defined(__CFA_NO_STATISTICS__)
     677                        if(woke) __tls_stats()->ready.sleep.wakes++;
     678                #endif
    675679        ready_schedule_unlock( id );
    676680
     
    969973        if( do_terminate ) return;
    970974
     975        #if !defined(__CFA_NO_STATISTICS__)
     976                __tls_stats()->ready.sleep.halts++;
     977        #endif
    971978        // Push self to queue
    972979        push(cltr->idles, *this);
     
    979986                        __wake_one( id, cltr );
    980987                ready_schedule_unlock( id );
     988                #if !defined(__CFA_NO_STATISTICS__)
     989                        __tls_stats()->ready.sleep.cancels++;
     990                #endif
    981991        }
    982992
Note: See TracChangeset for help on using the changeset viewer.