Changeset 34d194c
- Timestamp:
- Jul 5, 2026, 11:13:26 PM (4 days ago)
- Branches:
- master
- Children:
- 97c75bf
- Parents:
- 3859adb
- git-author:
- Peter A. Buhr <pabuhr@…> (07/05/26 23:05:57)
- git-committer:
- Peter A. Buhr <pabuhr@…> (07/05/26 23:13:26)
- Location:
- libcfa/src
- Files:
-
- 1 added
- 1 deleted
- 6 edited
-
Makefile.am (modified) (2 diffs)
-
bits/atomic.hfa (added)
-
bits/defs.hfa (modified) (2 diffs)
-
bits/locks.hfa (modified) (2 diffs)
-
concurrency/atomic.hfa (deleted)
-
concurrency/kernel/fwd.hfa (modified) (1 diff)
-
concurrency/locks.hfa (modified) (2 diffs)
-
heap.cfa (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/Makefile.am
r3859adb r34d194c 11 11 ## Created On : Sun May 31 08:54:01 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Wed Nov 1 19:03:42 202314 ## Update Count : 26 613 ## Last Modified On : Sat Jul 4 07:27:10 2026 14 ## Update Count : 267 15 15 ############################################################################### 16 16 … … 60 60 bits/queue.hfa \ 61 61 bits/sequence.hfa \ 62 concurrency/atomic.hfa \62 bits/atomic.hfa \ 63 63 concurrency/iofwd.hfa \ 64 64 concurrency/barrier.hfa \ -
libcfa/src/bits/defs.hfa
r3859adb r34d194c 13 13 // Created On : Thu Nov 9 13:24:10 2017 14 14 // Last Modified By : Peter A. Buhr 15 // Last Modified On : Mon Oct 27 22:40:05 202516 // Update Count : 2 315 // Last Modified On : Sat Jul 4 15:04:20 2026 16 // Update Count : 26 17 17 // 18 18 … … 68 68 #endif 69 69 70 static inline long long int rdtscl(void) {71 #if defined( __i386 ) || defined( __x86_64 )72 unsigned int lo, hi;73 __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));74 return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 );75 #elif defined( __aarch64__ ) || defined( __arm__ )76 // https://github.com/google/benchmark/blob/v1.1.0/src/cycleclock.h#L11677 long long int virtual_timer_value;78 asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));79 return virtual_timer_value;80 #else81 #error unsupported hardware architecture82 #endif83 }84 85 // pause to prevent excess processor bus usage86 #if defined( __i386 ) || defined( __x86_64 )87 #define Pause() __asm__ __volatile__ ( "pause" : : : )88 #elif defined( __ARM_ARCH )89 #define Pause() __asm__ __volatile__ ( "YIELD" : : : )90 #else91 #error unsupported architecture92 #endif93 94 70 #define CFA_IO_LAZY (1_l64u << 32_l64u) -
libcfa/src/bits/locks.hfa
r3859adb r34d194c 13 13 // Created On : Tue Oct 31 15:14:38 2017 14 14 // Last Modified By : Peter A. Buhr 15 // Last Modified On : Tue Sep 20 22:09:50 202216 // Update Count : 1815 // Last Modified On : Sat Jul 4 06:50:46 2026 16 // Update Count : 21 17 17 // 18 18 … … 21 21 #include "bits/debug.hfa" 22 22 #include "bits/defs.hfa" 23 #include "bits/atomic.hfa" 23 24 #include <assert.h> 24 25 -
libcfa/src/concurrency/kernel/fwd.hfa
r3859adb r34d194c 19 19 #include "bits/defs.hfa" 20 20 #include "bits/debug.hfa" 21 #include "bits/atomic.hfa" // Pause 21 22 22 23 #ifdef __cforall -
libcfa/src/concurrency/locks.hfa
r3859adb r34d194c 11 11 // Created On : Thu Jan 21 19:46:50 2021 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : S un Mar 29 22:46:39202614 // Update Count : 6813 // Last Modified On : Sat Jul 4 06:52:06 2026 14 // Update Count : 70 15 15 // 16 16 … … 21 21 22 22 #include "bits/weakso_locks.hfa" 23 #include "bits/atomic.hfa" 23 24 #include "collections/lockfree.hfa" 24 25 #include "collections/list.hfa" -
libcfa/src/heap.cfa
r3859adb r34d194c 10 10 // Created On : Tue Dec 19 21:58:35 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu May 15 16:47:35 202513 // Update Count : 16 4712 // Last Modified On : Sat Jul 4 16:17:06 2026 13 // Update Count : 1658 14 14 // 15 15 … … 25 25 26 26 #include "heap.hfa" 27 #include "bits/align.hfa" // libAlign 28 #include "bits/defs.hfa" // likely, unlikely 27 #include "bits/align.hfa" // libAlign, Pause, likely, unlikely 29 28 #include "concurrency/kernel/fwd.hfa" // disable_interrupts, enable_interrupts 30 29 #include "startup.hfa" // STARTUP_PRIORITY_MEMORY … … 129 128 } // Bsearchl 130 129 131 132 // pause to prevent excess processor bus usage133 #if defined( __i386 ) || defined( __x86_64 )134 #define Pause() __asm__ __volatile__ ( "pause" : : : )135 #elif defined(__ARM_ARCH)136 #define Pause() __asm__ __volatile__ ( "YIELD" : : : )137 #else138 #error unsupported architecture139 #endif140 141 130 typedef volatile uintptr_t SpinLock_t; 142 131 … … 146 135 147 136 for ( unsigned int i = 1;; i += 1 ) { 148 if ( slock == 0 && __atomic_test_and_set( &slock, __ATOMIC_ACQUIRE) == 0 ) break; // Fence137 if ( slock == 0 && AtomicTas( slock ) == 0 ) break; // Fence 149 138 for ( volatile unsigned int s = 0; s < spin; s += 1 ) Pause(); // exponential spin 150 139 spin += spin; // powers of 2 … … 155 144 156 145 static inline __attribute__((always_inline)) void unlock( volatile SpinLock_t & slock ) { 157 __atomic_clear( &slock, __ATOMIC_RELEASE );// Fence146 AtomicClr( slock ); // Fence 158 147 } // spin_unlock 159 148 … … 1003 992 unlock( freeHead->returnLock ); 1004 993 #else 1005 block = __atomic_exchange_n( &freeHead->returnList, 0p, __ATOMIC_SEQ_CST);994 block = AtomicFas( freeHead->returnList, 0p ); 1006 995 #endif // RETURNSPIN 1007 996 … … 1168 1157 header->kind.real.next = freeHead->returnList; // link new node to top node 1169 1158 // CAS resets header->kind.real.next = freeHead->returnList on failure 1170 while ( ! __atomic_compare_exchange_n( &freeHead->returnList, &header->kind.real.next, (Heap.Storage *)header, 1171 false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST ) ); 1159 while ( ! AtomicCasv( freeHead->returnList, header->kind.real.next, (Heap.Storage *)header ); 1172 1160 1173 1161 #ifdef __STATISTICS__
Note:
See TracChangeset
for help on using the changeset viewer.