Changeset 97c75bf


Ignore:
Timestamp:
Jul 5, 2026, 11:19:36 PM (5 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
9df6059
Parents:
34d194c
Message:

change routine name from rdtscl to rdtsc

Location:
libcfa/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/actor.hfa

    r34d194c r97c75bf  
    205205        this.msgs_stolen = 0;                                                           // number of messages stolen
    206206        #endif
    207         this.stamp = rdtscl();
     207        this.stamp = rdtsc();
    208208}
    209209
     
    631631                        CHECK_TERMINATION; // check for termination
    632632
    633                         __atomic_store_n( &executor_->w_infos[id].stamp, rdtscl(), __ATOMIC_RELAXED );
     633                        __atomic_store_n( &executor_->w_infos[id].stamp, rdtsc(), __ATOMIC_RELAXED );
    634634                       
    635635                        #ifdef ACTOR_STATS
  • libcfa/src/concurrency/io.cfa

    r34d194c r97c75bf  
    206206                        // update the timestamps accordingly
    207207                        // keep a local copy so we can update the relaxed copy
    208                         ts_next = ctx->cq.ts = rdtscl();
     208                        ts_next = ctx->cq.ts = rdtsc();
    209209
    210210                        // Mark to the kernel that the cqe has been seen
     
    274274
    275275                        const unsigned this_cache = cache_id(cltr, ctx->cq.id / __shard_factor.io);
    276                         const unsigned long long ctsc = rdtscl();
     276                        const unsigned long long ctsc = rdtsc();
    277277
    278278                        // only help once every other time
  • libcfa/src/concurrency/io/setup.cfa

    r34d194c r97c75bf  
    217217                cq.try_lock  = false;
    218218                cq.id        = MAX;
    219                 cq.ts        = rdtscl();
     219                cq.ts        = rdtsc();
    220220                cq.head      = (volatile __u32 *)(((intptr_t)cq.ring_ptr) + params.cq_off.head);
    221221                cq.tail      = (volatile __u32 *)(((intptr_t)cq.ring_ptr) + params.cq_off.tail);
  • libcfa/src/concurrency/kernel.cfa

    r34d194c r97c75bf  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Mar 29 21:20:54 2026
    13 // Update Count     : 83
     12// Last Modified On : Sat Jul  4 15:23:42 2026
     13// Update Count     : 84
    1414//
    1515
     
    150150        // Because of a bug, we couldn't initialized the seed on construction
    151151        // Do it here
    152         PRNG_SET_SEED( __cfaabi_tls.random_state, rdtscl() );
    153         __cfaabi_tls.ready_rng.fwd_seed = 25214903917_l64u * (rdtscl() ^ (uintptr_t)&runner);
     152        PRNG_SET_SEED( __cfaabi_tls.random_state, rdtsc() );
     153        __cfaabi_tls.ready_rng.fwd_seed = 25214903917_l64u * (rdtsc() ^ (uintptr_t)&runner);
    154154        __tls_rand_advance_bck();
    155155
     
    692692        this->idle_wctx.sem = 1;
    693693
    694         this->idle_wctx.wake__time = rdtscl();
     694        this->idle_wctx.wake__time = rdtsc();
    695695
    696696        eventfd_t val;
     
    723723        #if ! defined(__CFA_NO_STATISTICS__)
    724724                if (this->print_halts) {
    725                         __cfaabi_bits_print_safe( STDOUT_FILENO, "PH:%d - %lld 0\n", this->unique_id, rdtscl());
     725                        __cfaabi_bits_print_safe( STDOUT_FILENO, "PH:%d - %lld 0\n", this->unique_id, rdtsc());
    726726                }
    727727        #endif
     
    749749        #if ! defined(__CFA_NO_STATISTICS__)
    750750                if (this->print_halts) {
    751                         __cfaabi_bits_print_safe( STDOUT_FILENO, "PH:%d - %lld 1\n", this->unique_id, rdtscl());
     751                        __cfaabi_bits_print_safe( STDOUT_FILENO, "PH:%d - %lld 1\n", this->unique_id, rdtsc());
    752752                }
    753753        #endif
  • libcfa/src/concurrency/kernel/cluster.cfa

    r34d194c r97c75bf  
    278278        tscs = alloc(count, tscs`realloc);
    279279        for(i; count) {
    280                 tscs[i].t.tv = rdtscl();
     280                tscs[i].t.tv = rdtsc();
    281281                tscs[i].t.ma = 0;
    282282        }
  • libcfa/src/concurrency/kernel/cluster.hfa

    r34d194c r97c75bf  
    100100static inline void touch_tsc(__timestamp_t * tscs, size_t idx, unsigned long long ts_prev, unsigned long long ts_next, bool strict) {
    101101        if (ts_next == ULLONG_MAX) return;
    102         unsigned long long now = rdtscl();
     102        unsigned long long now = rdtsc();
    103103        __readyQ_avg_t pma = __atomic_load_n(&tscs[ idx ].t.ma, __ATOMIC_RELAXED);
    104104        __atomic_store_n(&tscs[ idx ].t.tv, ts_next, __ATOMIC_RELAXED);
  • libcfa/src/concurrency/kernel/startup.cfa

    r34d194c r97c75bf  
    509509        preferred = ready_queue_new_preferred();
    510510        last_proc = 0p;
    511         PRNG_SET_SEED( random_state, __global_random_mask ? __global_random_prime : __global_random_prime ^ rdtscl() );
     511        PRNG_SET_SEED( random_state, __global_random_mask ? __global_random_prime : __global_random_prime ^ rdtsc() );
    512512        #if defined( __CFA_WITH_VERIFY__ )
    513513                executing = 0p;
     
    868868#if defined(__CFA_WITH_VERIFY__)
    869869static bool verify_fwd_bck_rng(void) {
    870         __cfaabi_tls.ready_rng.fwd_seed = 25214903917_l64u * (rdtscl() ^ (uintptr_t)&verify_fwd_bck_rng);
     870        __cfaabi_tls.ready_rng.fwd_seed = 25214903917_l64u * (rdtsc() ^ (uintptr_t)&verify_fwd_bck_rng);
    871871
    872872        unsigned values[10];
  • libcfa/src/concurrency/ready_queue.cfa

    r34d194c r97c75bf  
    122122        // Figure out the current cache is
    123123        const unsigned this_cache = cache_id(cltr, this / __shard_factor.readyq);
    124         const unsigned long long ctsc = rdtscl();
     124        const unsigned long long ctsc = rdtsc();
    125125
    126126        if(proc->rdq.target == UINT_MAX) {
  • libcfa/src/concurrency/ready_subqueue.hfa

    r34d194c r97c75bf  
    5252        // Get the relevant nodes locally
    5353        this.l.prev->rdy_link.next = node;
    54         __atomic_store_n(&this.l.prev->rdy_link.ts, rdtscl(), __ATOMIC_RELAXED);
     54        __atomic_store_n(&this.l.prev->rdy_link.ts, rdtsc(), __ATOMIC_RELAXED);
    5555        this.l.prev = node;
    5656        #if !defined(__CFA_NO_STATISTICS__)
  • libcfa/src/concurrency/stats.cfa

    r34d194c r97c75bf  
    221221                        if(external) unlock(stats_lock);
    222222
    223                         this->array.values[idx].ts = rdtscl();
     223                        this->array.values[idx].ts = rdtsc();
    224224                        this->array.values[idx].value = value;
    225225                }
  • libcfa/src/concurrency/thread.cfa

    r34d194c r97c75bf  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Sep  3 08:25:21 2023
    13 // Update Count     : 105
     12// Last Modified On : Sat Jul  4 15:21:11 2026
     13// Update Count     : 106
    1414//
    1515
     
    5454        last_proc = 0p;
    5555    link_node = 0p;
    56         PRNG_SET_SEED( random_state, __global_random_mask ? __global_random_prime : __global_random_prime ^ rdtscl() );
     56        PRNG_SET_SEED( random_state, __global_random_mask ? __global_random_prime : __global_random_prime ^ rdtsc() );
    5757        #if defined( __CFA_WITH_VERIFY__ )
    5858                executing = 0p;
  • libcfa/src/startup.cfa

    r34d194c r97c75bf  
    1010// Created On       : Tue Jul 24 16:21:57 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Dec  5 11:41:58 2022
    13 // Update Count     : 73
     12// Last Modified On : Sat Jul  4 15:28:52 2026
     13// Update Count     : 88
    1414//
    1515
     
    1717#include <locale.h>                                                                             // setlocale
    1818#include <stdlib.h>                                                                             // getenv
    19 #include "bits/defs.hfa"                                                                // rdtscl
    20 #include "bits/random.hfa"                                                              // rdtscl
     19#include "bits/defs.hfa"                                                                // libcfa_nopreempt
     20#include "bits/random.hfa"                                                              // PRNG
     21#include "bits/atomic.hfa"                                                              // rdtsc
    2122#include "startup.hfa"
    2223
     
    3940        void __cfaabi_appready_startup( void ) __attribute__(( constructor( STARTUP_PRIORITY_APPREADY ) ));
    4041        void __cfaabi_appready_startup( void ) {
     42                // Initialized here to prevent unfreed memory messages.
    4143                tzset();                                                                                // initialize time global variables
     44                setlocale( LC_ALL, getenv( "LANG" ) );                  // print digit separator
     45                setlocale( LC_ALL, "C" );
    4246                extern void heapAppStart();
    4347                heapAppStart();
     
    6973        void __cfaabi_core_startup( void ) __attribute__(( constructor( STARTUP_PRIORITY_CORE ) ));
    7074        void __cfaabi_core_startup( void ) {
    71                 __global_random_seed = rdtscl();
     75                __global_random_seed = rdtsc();
    7276                PRNG_SET_SEED( __global_random_state, __global_random_seed );
    7377
  • libcfa/src/stdlib.hfa

    r34d194c r97c75bf  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 18 22:25:25 2024
    13 // Update Count     : 965
     12// Last Modified On : Sat Jul  4 15:28:46 2026
     13// Update Count     : 970
    1414//
    1515
     
    1919#include "bits/align.hfa"                                                               // libAlign
    2020#include "bits/random.hfa"                                                              // prng
     21#include "bits/atomic.hfa"                                                              // rdtsc
    2122#include <Exception.hfa>
    2223#include <heap.hfa>
     
    484485        uint32_t get_seed( PRNG32 & prng ) __attribute__(( warn_unused_result )) with( prng ) { return seed; }
    485486        void ?{}( PRNG32 & prng, uint32_t seed ) with( prng ) { callcnt = 0; set_seed( prng, seed ); } // fixed seed
    486         void ?{}( PRNG32 & prng ) with( prng ) { ?{}( prng, rdtscl() ); } // random seed
     487        void ?{}( PRNG32 & prng ) with( prng ) { ?{}( prng, rdtsc() ); } // random seed
    487488        uint32_t prng( PRNG32 & prng ) __attribute__(( warn_unused_result )) with( prng ) { callcnt += 1; return PRNG_NAME_32( state ); } // [0,UINT_MAX]
    488489        uint32_t prng( PRNG32 & prng, uint32_t u ) __attribute__(( warn_unused_result )) { return prng( prng ) % u; } // [0,u)
     
    504505        uint64_t get_seed( PRNG64 & prng ) __attribute__(( warn_unused_result )) with( prng ) { return seed; }
    505506        void ?{}( PRNG64 & prng, uint64_t seed ) with( prng ) { callcnt = 0; set_seed( prng, seed ); } // fixed seed
    506         void ?{}( PRNG64 & prng ) with( prng ) { ?{}( prng, rdtscl() ); } // random seed
     507        void ?{}( PRNG64 & prng ) with( prng ) { ?{}( prng, rdtsc() ); } // random seed
    507508        uint64_t prng( PRNG64 & prng ) __attribute__(( warn_unused_result )) with( prng ) { callcnt += 1; return PRNG_NAME_64( state ); } // [0,UINT_MAX]
    508509        uint64_t prng( PRNG64 & prng, uint64_t u ) __attribute__(( warn_unused_result )) { return prng( prng ) % u; } // [0,u)
Note: See TracChangeset for help on using the changeset viewer.