Ignore:
Timestamp:
Aug 7, 2017, 12:50:17 PM (7 years ago)
Author:
alain
Message:

Introduce the delayed context switch if current thread has a lock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/core.c

    r296 r337  
    117117        if( (ticks % 10) == 0 ) sched_yield( NULL );
    118118
     119/*
     120    // compute elapsed time, taking into account 32 bits register wrap
     121    uint32_t elapsed;
     122    uint32_t time_now   = hal_get_cycles();
     123    uint32_t time_last  = this->time_last_check;
     124    if( time_now < time_last ) elapsed = (0xFFFFFFFF - time_last) + time_now;
     125        else                       elapsed = time_now - time_last;
     126
     127    // update thread time
     128    this->time_last_check = time_now;
     129
     130        // check elapsed time
     131        if( elapsed < CONFIG_CORE_CHECK_EVERY ) return false;
     132    else                                    return true;
     133*/
     134
    119135        // update DQDT TODO  This update should depend on the cluster identifier,
    120136        // to avoid simultaneous updates from various clusters ... AG
Note: See TracChangeset for help on using the changeset viewer.