Changes in / [00f5fde:1959528]
- Files:
-
- 11 edited
-
libcfa/src/bits/locks.hfa (modified) (3 diffs)
-
libcfa/src/concurrency/io.cfa (modified) (1 diff)
-
libcfa/src/concurrency/kernel.cfa (modified) (2 diffs)
-
libcfa/src/concurrency/ready_queue.cfa (modified) (1 diff)
-
libcfa/src/concurrency/thread.cfa (modified) (2 diffs)
-
libcfa/src/device/cpu.cfa (modified) (1 diff)
-
libcfa/src/device/cpu.hfa (modified) (1 diff)
-
libcfa/src/startup.cfa (modified) (3 diffs)
-
libcfa/src/stdlib.cfa (modified) (2 diffs)
-
libcfa/src/stdlib.hfa (modified) (2 diffs)
-
tools/jenkins/setup.sh.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/locks.hfa
r00f5fde r1959528 31 31 // previous thread to acquire the lock 32 32 void* prev_thrd; 33 // keep track of number of times we had to spin, just in case the number is unexpectedly huge34 size_t spin_count;35 33 #endif 36 34 }; … … 50 48 static inline void ?{}( __spinlock_t & this ) { 51 49 this.lock = 0; 52 #ifdef __CFA_DEBUG__53 this.spin_count = 0;54 #endif55 50 } 56 51 … … 77 72 for ( unsigned int i = 1;; i += 1 ) { 78 73 if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break; 79 #ifdef __CFA_DEBUG__80 this.spin_count++;81 #endif82 74 #ifndef NOEXPBACK 83 75 // exponential spin -
libcfa/src/concurrency/io.cfa
r00f5fde r1959528 548 548 /* paranoid */ verify( proc == __cfaabi_tls.this_processor ); 549 549 /* paranoid */ verify( ! __preemption_enabled() ); 550 551 return true;552 550 } 553 551 #endif -
libcfa/src/concurrency/kernel.cfa
r00f5fde r1959528 554 554 /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd->canary ); 555 555 556 const bool local = thrd->state != Start; 556 557 if (thrd->preempted == __NO_PREEMPTION) thrd->state = Ready; 557 558 … … 736 737 737 738 // Check if there is a sleeping processor 738 // int fd = __atomic_load_n(&this->procs.fd, __ATOMIC_SEQ_CST); 739 int fd = 0; 740 if( __atomic_load_n(&this->procs.fd, __ATOMIC_SEQ_CST) != 0 ) { 741 fd = __atomic_exchange_n(&this->procs.fd, 0, __ATOMIC_RELAXED); 742 } 739 int fd = __atomic_load_n(&this->procs.fd, __ATOMIC_SEQ_CST); 743 740 744 741 // If no one is sleeping, we are done -
libcfa/src/concurrency/ready_queue.cfa
r00f5fde r1959528 681 681 // Actually pop the list 682 682 struct thread$ * thrd; 683 #if defined(USE_WORK_STEALING) || defined(USE_CPU_WORK_STEALING) 684 unsigned long long tsc_before = ts(lane); 685 #endif 683 unsigned long long tsc_before = ts(lane); 686 684 unsigned long long tsv; 687 685 [thrd, tsv] = pop(lane); -
libcfa/src/concurrency/thread.cfa
r00f5fde r1959528 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 12 18: 46:48 202213 // Update Count : 3 612 // Last Modified On : Wed Jan 12 18:28:18 2022 13 // Update Count : 35 14 14 // 15 15 … … 197 197 } // LCG 198 198 199 void set_seed( uint32_t seed ) { 200 active_thread()->random_state = __global_random_seed = seed; 201 GENERATOR( active_thread()->random_state ); 202 } // set_seed 199 void set_seed( uint32_t seed ) { active_thread()->random_state = seed; __global_random_seed = seed; } 203 200 uint32_t prng( void ) { return GENERATOR( active_thread()->random_state ); } // [0,UINT_MAX] 204 201 -
libcfa/src/device/cpu.cfa
r00f5fde r1959528 427 427 unsigned c = pairings[i].cpu; 428 428 unsigned llc_id = pairings[i].id; 429 unsigned width = maps[llc_id].raw->width; 429 430 unsigned start = maps[llc_id].start; 430 entries[c].count = maps[llc_id].raw->width; 431 unsigned self = start + (maps[llc_id].count++); 432 entries[c].count = width; 431 433 entries[c].start = start; 432 entries[c].self = start + (maps[llc_id].count++); 433 entries[c].cache = llc_id; 434 entries[c].self = self; 434 435 } 435 436 -
libcfa/src/device/cpu.hfa
r00f5fde r1959528 16 16 #include <stddef.h> 17 17 18 // Map from cpu entry to a structure detailling cpus with common topologies19 // Note that the cpu-groups are contiguous so the indexing is different from20 // the cpu indexing21 18 struct cpu_map_entry_t { 22 // Where this particular cpu is in the group23 19 unsigned self; 24 25 // Starting index of the cpus with the same topology26 20 unsigned start; 27 28 // Number of cpus with the same topology29 21 unsigned count; 30 31 // Index of the cache this entry describes32 unsigned cache;33 22 }; 34 23 -
libcfa/src/startup.cfa
r00f5fde r1959528 10 10 // Created On : Tue Jul 24 16:21:57 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 12 1 8:51:24202213 // Update Count : 5112 // Last Modified On : Wed Jan 12 16:25:37 2022 13 // Update Count : 49 14 14 // 15 15 … … 20 20 #include "bits/defs.hfa" 21 21 22 extern uint32_t __global_random_seed , __global_random_state;22 extern uint32_t __global_random_seed; 23 23 24 24 extern "C" { … … 51 51 void __cfaabi_core_startup( void ) __attribute__(( constructor( STARTUP_PRIORITY_CORE ) )); 52 52 void __cfaabi_core_startup( void ) { 53 __global_random_s tate = __global_random_seed = rdtscl();53 __global_random_seed = rdtscl(); 54 54 __cfaabi_interpose_startup(); 55 55 __cfaabi_device_startup(); -
libcfa/src/stdlib.cfa
r00f5fde r1959528 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 12 1 8:52:41202213 // Update Count : 5 8212 // Last Modified On : Wed Jan 12 16:25:36 2022 13 // Update Count : 578 14 14 // 15 15 … … 242 242 } // LCG 243 243 244 uint32_t __global_random_seed; // sequential/concurrent 245 uint32_t __global_random_state; // sequential only 244 uint32_t __global_random_seed; 246 245 247 246 void set_seed( PRNG & prng, uint32_t seed_ ) with( prng ) { state = seed = seed_; GENERATOR( state ); } // set seed 248 247 uint32_t prng( PRNG & prng ) with( prng ) { callcnt += 1; return GENERATOR( state ); } 249 248 250 void set_seed( uint32_t seed ) { __global_random_seed = seed; GENERATOR( __global_random_state ); } 249 void set_seed( uint32_t seed ) { 250 active_thread()->random_state = __global_random_seed = seed; 251 GENERATOR( active_thread()->random_state ); 252 } // set_seed 251 253 uint32_t get_seed() { return __global_random_seed; } 252 uint32_t prng( void ) { return GENERATOR( __global_random_state ); } // [0,UINT_MAX]254 uint32_t prng( void ) { return GENERATOR( active_thread()->random_state ); } // [0,UINT_MAX] 253 255 254 256 //--------------------------------------- -
libcfa/src/stdlib.hfa
r00f5fde r1959528 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 12 18:56:13202213 // Update Count : 62 112 // Last Modified On : Wed Jan 12 09:09:48 2022 13 // Update Count : 620 14 14 // 15 15 … … 437 437 438 438 void set_seed( uint32_t seed_ ) OPTIONAL_THREAD; 439 uint32_t get_seed() __attribute__(( warn_unused_result )) ;439 uint32_t get_seed() __attribute__(( warn_unused_result )) OPTIONAL_THREAD; 440 440 uint32_t prng( void ) __attribute__(( warn_unused_result )) OPTIONAL_THREAD; // [0,UINT_MAX] 441 441 static inline { -
tools/jenkins/setup.sh.in
r00f5fde r1959528 48 48 regex1='/([[:alpha:][:digit:]@/_.-]+)' 49 49 regex2='(libcfa[[:alpha:][:digit:].]+) => not found' 50 regex3='linux-vdso.so.1 |linux-gate.so.1'50 regex3='linux-vdso.so.1' 51 51 if [[ $line =~ $regex1 ]]; then 52 52 retsysdeps+=(${BASH_REMATCH[1]})
Note:
See TracChangeset
for help on using the changeset viewer.