Changeset 5cb51502 for libcfa


Ignore:
Timestamp:
Apr 5, 2021, 3:18:12 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:
b0904bf
Parents:
c9ec301
Message:

Fix stats so they are correctly tallied when called from outside the cluster.

Location:
libcfa/src/concurrency
Files:
4 edited

Legend:

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

    rc9ec301 r5cb51502  
    490490                        {
    491491                                /* paranoid */ verify( publicTLS_get(this_proc_id) );
    492                                 bool full = publicTLS_get(this_proc_id)->full_proc;
    493                                 if(full) disable_interrupts();
     492                                disable_interrupts();
    494493
    495494                                /* paranoid */ verify( ! __preemption_enabled() );
     
    500499                                /* paranoid */ verify( ! __preemption_enabled() );
    501500
    502                                 if(full) enable_interrupts( __cfaabi_dbg_ctx );
     501                                enable_interrupts_noPoll();
    503502                                /* paranoid */ verify( publicTLS_get(this_proc_id) );
    504503                        }
     
    609608
    610609        #if !defined(__CFA_NO_STATISTICS__)
    611                 __tls_stats()->ready.sleep.wakes++;
     610                if( kernelTLS().this_stats ) {
     611                        __tls_stats()->ready.sleep.wakes++;
     612                }
     613                else {
     614                        __atomic_fetch_add(&this->stats->ready.sleep.wakes, 1, __ATOMIC_RELAXED);
     615                }
    612616        #endif
    613617
  • libcfa/src/concurrency/kernel.hfa

    rc9ec301 r5cb51502  
    5151struct __processor_id_t {
    5252        unsigned id:24;
    53         bool full_proc:1;
    5453
    5554        #if !defined(__CFA_NO_STATISTICS__)
  • libcfa/src/concurrency/kernel/startup.cfa

    rc9ec301 r5cb51502  
    455455        this.name = name;
    456456        this.cltr = &_cltr;
    457         full_proc = true;
    458457        do_terminate = false;
    459458        preemption_alarm = 0p;
  • libcfa/src/concurrency/ready_queue.cfa

    rc9ec301 r5cb51502  
    245245        __cfadbg_print_safe(ready_queue, "Kernel : Pushing %p on cluster %p\n", thrd, cltr);
    246246
    247         #if !defined(__CFA_NO_STATISTICS__)
    248                 const bool external = (!kernelTLS().this_proc_id->full_proc) || (cltr != kernelTLS().this_processor->cltr);
    249         #endif
     247        const bool external = (!kernelTLS().this_processor) || (cltr != kernelTLS().this_processor->cltr);
    250248
    251249        // write timestamp
     
    258256                preferred =
    259257                        //*
    260                         kernelTLS().this_processor ? kernelTLS().this_processor->cltr_id : -1;
     258                        external ? -1 : kernelTLS().this_processor->cltr_id;
    261259                        /*/
    262260                        thrd->link.preferred * 4;
Note: See TracChangeset for help on using the changeset viewer.