Ignore:
Timestamp:
Mar 22, 2022, 3:28:29 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
ff7b2de
Parents:
8f01ad71
Message:

I/O now updates the timestamps when draining.
Timestamps are not used yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/cluster.hfa

    r8f01ad71 r78a580d  
    1616#pragma once
    1717
     18#include "device/cpu.hfa"
    1819#include "kernel/private.hfa"
     20
     21#include "limits.hfa"
    1922
    2023//-----------------------------------------------------------------------
     
    3134        const unsigned long long ret = ((new_weight * new_val) + (old_weight * old_avg)) / total_weight;
    3235        return ret;
     36}
     37
     38static inline void touch_tsc(__timestamp_t * tscs, size_t idx, unsigned long long ts_prev, unsigned long long ts_next) {
     39        if (ts_next == MAX) return;
     40        unsigned long long now = rdtscl();
     41        unsigned long long pma = __atomic_load_n(&tscs[ idx ].ma, __ATOMIC_RELAXED);
     42        __atomic_store_n(&tscs[ idx ].tv, ts_next, __ATOMIC_RELAXED);
     43        __atomic_store_n(&tscs[ idx ].ma, moving_average(now, ts_prev, pma), __ATOMIC_RELAXED);
    3344}
    3445
Note: See TracChangeset for help on using the changeset viewer.