Changeset 00f5fde
- Timestamp:
- Jan 12, 2022, 9:30:48 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 42daeb4
- Parents:
- 1959528 (diff), 07a1e7a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Peter A. Buhr <pabuhr@…> (01/12/22 18:35:04)
- git-committer:
- Peter A. Buhr <pabuhr@…> (01/12/22 21:30:48)
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/locks.hfa
r1959528 r00f5fde 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 huge 34 size_t spin_count; 33 35 #endif 34 36 }; … … 48 50 static inline void ?{}( __spinlock_t & this ) { 49 51 this.lock = 0; 52 #ifdef __CFA_DEBUG__ 53 this.spin_count = 0; 54 #endif 50 55 } 51 56 … … 72 77 for ( unsigned int i = 1;; i += 1 ) { 73 78 if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break; 79 #ifdef __CFA_DEBUG__ 80 this.spin_count++; 81 #endif 74 82 #ifndef NOEXPBACK 75 83 // exponential spin -
libcfa/src/concurrency/io.cfa
r1959528 r00f5fde 548 548 /* paranoid */ verify( proc == __cfaabi_tls.this_processor ); 549 549 /* paranoid */ verify( ! __preemption_enabled() ); 550 551 return true; 550 552 } 551 553 #endif -
libcfa/src/concurrency/kernel.cfa
r1959528 r00f5fde 554 554 /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd->canary ); 555 555 556 const bool local = thrd->state != Start;557 556 if (thrd->preempted == __NO_PREEMPTION) thrd->state = Ready; 558 557 … … 737 736 738 737 // Check if there is a sleeping processor 739 int fd = __atomic_load_n(&this->procs.fd, __ATOMIC_SEQ_CST); 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 } 740 743 741 744 // If no one is sleeping, we are done -
libcfa/src/concurrency/ready_queue.cfa
r1959528 r00f5fde 681 681 // Actually pop the list 682 682 struct thread$ * thrd; 683 unsigned long long tsc_before = ts(lane); 683 #if defined(USE_WORK_STEALING) || defined(USE_CPU_WORK_STEALING) 684 unsigned long long tsc_before = ts(lane); 685 #endif 684 686 unsigned long long tsv; 685 687 [thrd, tsv] = pop(lane); -
libcfa/src/concurrency/thread.cfa
r1959528 r00f5fde 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: 28:18 202213 // Update Count : 3 512 // Last Modified On : Wed Jan 12 18:46:48 2022 13 // Update Count : 36 14 14 // 15 15 … … 197 197 } // LCG 198 198 199 void set_seed( uint32_t seed ) { active_thread()->random_state = seed; __global_random_seed = seed; } 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 200 203 uint32_t prng( void ) { return GENERATOR( active_thread()->random_state ); } // [0,UINT_MAX] 201 204 -
libcfa/src/device/cpu.cfa
r1959528 r00f5fde 427 427 unsigned c = pairings[i].cpu; 428 428 unsigned llc_id = pairings[i].id; 429 unsigned width = maps[llc_id].raw->width;430 429 unsigned start = maps[llc_id].start; 431 unsigned self = start + (maps[llc_id].count++); 432 entries[c].count = width; 430 entries[c].count = maps[llc_id].raw->width; 433 431 entries[c].start = start; 434 entries[c].self = self; 432 entries[c].self = start + (maps[llc_id].count++); 433 entries[c].cache = llc_id; 435 434 } 436 435 -
libcfa/src/device/cpu.hfa
r1959528 r00f5fde 16 16 #include <stddef.h> 17 17 18 // Map from cpu entry to a structure detailling cpus with common topologies 19 // Note that the cpu-groups are contiguous so the indexing is different from 20 // the cpu indexing 18 21 struct cpu_map_entry_t { 22 // Where this particular cpu is in the group 19 23 unsigned self; 24 25 // Starting index of the cpus with the same topology 20 26 unsigned start; 27 28 // Number of cpus with the same topology 21 29 unsigned count; 30 31 // Index of the cache this entry describes 32 unsigned cache; 22 33 }; 23 34 -
libcfa/src/startup.cfa
r1959528 r00f5fde 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 6:25:37202213 // Update Count : 4912 // Last Modified On : Wed Jan 12 18:51:24 2022 13 // Update Count : 51 14 14 // 15 15 … … 20 20 #include "bits/defs.hfa" 21 21 22 extern uint32_t __global_random_seed ;22 extern uint32_t __global_random_seed, __global_random_state; 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 eed = rdtscl();53 __global_random_state = __global_random_seed = rdtscl(); 54 54 __cfaabi_interpose_startup(); 55 55 __cfaabi_device_startup(); -
libcfa/src/stdlib.cfa
r1959528 r00f5fde 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 6:25:36202213 // Update Count : 5 7812 // Last Modified On : Wed Jan 12 18:52:41 2022 13 // Update Count : 582 14 14 // 15 15 … … 242 242 } // LCG 243 243 244 uint32_t __global_random_seed; 244 uint32_t __global_random_seed; // sequential/concurrent 245 uint32_t __global_random_state; // sequential only 245 246 246 247 void set_seed( PRNG & prng, uint32_t seed_ ) with( prng ) { state = seed = seed_; GENERATOR( state ); } // set seed 247 248 uint32_t prng( PRNG & prng ) with( prng ) { callcnt += 1; return GENERATOR( state ); } 248 249 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 250 void set_seed( uint32_t seed ) { __global_random_seed = seed; GENERATOR( __global_random_state ); } 253 251 uint32_t get_seed() { return __global_random_seed; } 254 uint32_t prng( void ) { return GENERATOR( active_thread()->random_state ); } // [0,UINT_MAX]252 uint32_t prng( void ) { return GENERATOR( __global_random_state ); } // [0,UINT_MAX] 255 253 256 254 //--------------------------------------- -
libcfa/src/stdlib.hfa
r1959528 r00f5fde 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 09:09:48202213 // Update Count : 62 012 // Last Modified On : Wed Jan 12 18:56:13 2022 13 // Update Count : 621 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 )) OPTIONAL_THREAD;439 uint32_t get_seed() __attribute__(( warn_unused_result )); 440 440 uint32_t prng( void ) __attribute__(( warn_unused_result )) OPTIONAL_THREAD; // [0,UINT_MAX] 441 441 static inline { -
tools/jenkins/setup.sh.in
r1959528 r00f5fde 48 48 regex1='/([[:alpha:][:digit:]@/_.-]+)' 49 49 regex2='(libcfa[[:alpha:][:digit:].]+) => not found' 50 regex3='linux-vdso.so.1 '50 regex3='linux-vdso.so.1|linux-gate.so.1' 51 51 if [[ $line =~ $regex1 ]]; then 52 52 retsysdeps+=(${BASH_REMATCH[1]})
Note: See TracChangeset
for help on using the changeset viewer.