preshing / turf Goto Github PK
View Code? Open in Web Editor NEWConfigurable C++ platform adapter
License: Other
Configurable C++ platform adapter
License: Other
Hi Jeff,
this repository is awesome, thank you!
there is ARM and X86_64 support in turf/c/impl/, MIPS support is also something that would be nice to have.
I'm not sure if raising an issue would be the right way to start the discussion, please feel free to close the issue if you don't plan/want to add MIPS support in the future.
Thanks!
turf/impl/Affinity_Linux.cpp:62:14: error: use of undeclared identifier 'pthread_setaffinity_np'; did you mean 'sched_setaffinity'?
Any plans to also support a recent version of clang on linux in addition to gcc?
Thanks for your excellent blog articles and libs.
---
turf/impl/Affinity_FreeBSD.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/turf/impl/Affinity_FreeBSD.cpp b/turf/impl/Affinity_FreeBSD.cpp
index d3ec6ae..24f8ddc 100644
--- a/turf/impl/Affinity_FreeBSD.cpp
+++ b/turf/impl/Affinity_FreeBSD.cpp
@@ -71,7 +71,7 @@ static bool cpuid(pcpu_regs_t regs)
u32 pre_change, post_change;
const u32 id_flag = 0x200000;
asm ("pushfl\n\t" /* Save %eflags to restore later. */
- "pushfl\n\t" /* Push second copy, for manipulation. *
+ "pushfl\n\t" /* Push second copy, for manipulation. */
"popl %1\n\t" /* Pop it into post_change. */
"movl %1,%0\n\t" /* Save copy in pre_change. */
"xorl %2,%1\n\t" /* Tweak bit in post_change. */
--
2.7.0
When running with boost through visual studio, RecursiveMutexTester does not exit. I assume there is a deadlock.
REPRO:
#elif defined(__arm64__) || defined(__aarch64__ )
#if defined(__ARM64_ARCH_8__) || defined(__ARM_ARCH_8A) || defined(__ARM_ARCH)
TURF_CPU_ARM || TURF_CPU_ARM64 ||
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-DTURF_COMPILER_GCC)
add_definitions(-DTURF_CPU_ARM)
Using built-in specs.
COLLECT_GCC=/usr/bin/aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/5/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 5.4.0-6kord1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-arm64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-arm64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-arm64 --with-arch-directory=aarch64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6kord1~16.04.12)
then compile the demo. but there has some assembler error.
[main] Building folder: junction-sample
[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /tmp/junction-sample/build --config Debug --target all -j 6 --
[build] Consolidate compiler generated dependencies of target turf
[build] Consolidate compiler generated dependencies of target junction
[build] [ 3%] Building CXX object junction/turf/CMakeFiles/turf.dir/turf/UTCTime.cpp.o
[build] [ 7%] Building CXX object junction/turf/CMakeFiles/turf.dir/turf/Heap.cpp.o
[build] [ 14%] Building CXX object junction/turf/CMakeFiles/turf.dir/turf/Core.cpp.o
[build] [ 14%] Building C object junction/turf/CMakeFiles/turf.dir/turf/c/impl/atomic_gcc_arm.c.o
[build] [ 21%] Building CXX object junction/CMakeFiles/junction.dir/junction/ConcurrentMap_Grampa.cpp.o
[build] [ 21%] Building CXX object junction/turf/CMakeFiles/turf.dir/turf/extra/Options.cpp.o
[build] /tmp/ccXshPqk.s: Assembler messages:
[build] /tmp/ccXshPqk.s:11: 错误:operand 1 should be an integer register -- `mov r2,r0'
[build] /tmp/ccXshPqk.s:13: 错误:unknown mnemonic `ldrexd' -- `ldrexd r0,r1,[r2]'
[build] /tmp/ccXshPqk.s:14: 错误:unknown mnemonic `strexd' -- `strexd r3,r0,r1,[r2]'
[build] /tmp/ccXshPqk.s:15: 错误:operand 1 should be an integer or stack pointer register -- `cmp r3,#0'
[build] /tmp/ccXshPqk.s:17: 错误:unknown mnemonic `bx' -- `bx lr'
[build] /tmp/ccXshPqk.s:23: 错误:unknown mnemonic `push' -- `push {r4-r5}'
[build] /tmp/ccXshPqk.s:24: 错误:operand 1 should be an integer register -- `mov r5,r0'
[build] /tmp/ccXshPqk.s:25: 错误:operand 1 should be an integer register -- `mov r3,r2'
[build] /tmp/ccXshPqk.s:26: 错误:operand 1 should be an integer register -- `mov r2,r1'
[build] /tmp/ccXshPqk.s:28: 错误:unknown mnemonic `ldrexd' -- `ldrexd r0,r1,[r5]'
[build] /tmp/ccXshPqk.s:29: 错误:unknown mnemonic `strexd' -- `strexd r4,r2,r3,[r5]'
[build] /tmp/ccXshPqk.s:30: 错误:operand 1 should be an integer or stack pointer register -- `cmp r4,#0'
[build] /tmp/ccXshPqk.s:32: 错误:unknown mnemonic `pop' -- `pop {r4-r5}'
[build] /tmp/ccXshPqk.s:33: 错误:unknown mnemonic `bx' -- `bx lr'
[build] /tmp/ccXshPqk.s:39: 错误:unknown mnemonic `push' -- `push {r4-r7}'
[build] /tmp/ccXshPqk.s:40: 错误:operand 1 should be an integer register -- `mov r6,r3'
[build] /tmp/ccXshPqk.s:41: 错误:operand 1 should be an integer register -- `ldr r7,[sp,#16]'
[build] /tmp/ccXshPqk.s:42: 错误:operand 1 should be an integer register -- `mov r5,r0'
[build] /tmp/ccXshPqk.s:43: 错误:operand 1 should be an integer register -- `mov r4,r1'
[build] /tmp/ccXshPqk.s:45: 错误:unknown mnemonic `ldrexd' -- `ldrexd r0,r1,[r5]'
[build] /tmp/ccXshPqk.s:46: 错误:operand 1 should be an integer or stack pointer register -- `cmp r0,r4'
[build] /tmp/ccXshPqk.s:47: 错误:unknown mnemonic `cmpeq' -- `cmpeq r1,r2'
[build] /tmp/ccXshPqk.s:49: 错误:unknown mnemonic `strexd' -- `strexd r3,r6,r7,[r5]'
[build] /tmp/ccXshPqk.s:50: 错误:operand 1 should be an integer or stack pointer register -- `cmp r3,#0'
[build] /tmp/ccXshPqk.s:53: 错误:unknown mnemonic `pop' -- `pop {r4-r7}'
[build] /tmp/ccXshPqk.s:54: 错误:unknown mnemonic `bx' -- `bx lr'
[build] /tmp/ccXshPqk.s:60: 错误:unknown mnemonic `push' -- `push {r4-r7}'
[build] /tmp/ccXshPqk.s:61: 错误:operand 1 should be an integer register -- `mov r6,r3'
[build] /tmp/ccXshPqk.s:62: 错误:operand 1 should be an integer register -- `ldr r7,[sp,#16]'
[build] /tmp/ccXshPqk.s:63: 错误:operand 1 should be an integer register -- `mov r5,r0'
[build] /tmp/ccXshPqk.s:64: 错误:operand 1 should be an integer register -- `mov r4,r1'
[build] /tmp/ccXshPqk.s:66: 错误:unknown mnemonic `ldrexd' -- `ldrexd r0,r1,[r5]'
[build] /tmp/ccXshPqk.s:67: 错误:operand 1 should be an integer or stack pointer register -- `cmp r0,r4'
[build] /tmp/ccXshPqk.s:68: 错误:unknown mnemonic `cmpeq' -- `cmpeq r1,r2'
[build] /tmp/ccXshPqk.s:70: 错误:unknown mnemonic `strexd' -- `strexd r3,r6,r7,[r5]'
[build] /tmp/ccXshPqk.s:71: 错误:operand 1 should be an integer or stack pointer register -- `cmp r3,#0'
[build] /tmp/ccXshPqk.s:74: 错误:unknown mnemonic `pop' -- `pop {r4-r7}'
[build] /tmp/ccXshPqk.s:75: 错误:unknown mnemonic `bx' -- `bx lr'
[build] /tmp/ccXshPqk.s:81: 错误:unknown mnemonic `push' -- `push {r4-r7}'
[build] /tmp/ccXshPqk.s:82: 错误:operand 1 should be an integer register -- `mov r5,r0'
[build] /tmp/ccXshPqk.s:83: 错误:operand 1 should be an integer register -- `mov r4,r1'
[build] /tmp/ccXshPqk.s:85: 错误:unknown mnemonic `ldrexd' -- `ldrexd r0,r1,[r5]'
[build] /tmp/ccXshPqk.s:86: 错误:operand 1 should be an integer register -- `adds r6,r0,r4'
[build] /tmp/ccXshPqk.s:87: 错误:operand 1 should be an integer register -- `adc r7,r1,r2'
[build] /tmp/ccXshPqk.s:88: 错误:unknown mnemonic `strexd' -- `strexd r3,r6,r7,[r5]'
[build] /tmp/ccXshPqk.s:89: 错误:operand 1 should be an integer or stack pointer register -- `cmp r3,#0'
[build] /tmp/ccXshPqk.s:91: 错误:unknown mnemonic `pop' -- `pop {r4-r7}'
[build] /tmp/ccXshPqk.s:92: 错误:unknown mnemonic `bx' -- `bx lr'
[build] /tmp/ccXshPqk.s:98: 错误:unknown mnemonic `push' -- `push {r4-r7}'
[build] /tmp/ccXshPqk.s:99: 错误:operand 1 should be an integer register -- `mov r5,r0'
[build] /tmp/ccXshPqk.s:100: 错误:operand 1 should be an integer register -- `mov r4,r1'
[build] /tmp/ccXshPqk.s:102: 错误:unknown mnemonic `ldrexd' -- `ldrexd r0,r1,[r5]'
[build] /tmp/ccXshPqk.s:103: 错误:operand 1 should be an integer or stack pointer register -- `and r6,r0,r4'
[build] /tmp/ccXshPqk.s:104: 错误:operand 1 should be an integer or stack pointer register -- `and r7,r1,r2'
[build] /tmp/ccXshPqk.s:105: 错误:unknown mnemonic `strexd' -- `strexd r3,r6,r7,[r5]'
[build] /tmp/ccXshPqk.s:106: 错误:operand 1 should be an integer or stack pointer register -- `cmp r3,#0'
[build] /tmp/ccXshPqk.s:108: 错误:unknown mnemonic `pop' -- `pop {r4-r7}'
[build] /tmp/ccXshPqk.s:109: 错误:unknown mnemonic `bx' -- `bx lr'
[build] /tmp/ccXshPqk.s:115: 错误:unknown mnemonic `push' -- `push {r4-r7}'
[build] /tmp/ccXshPqk.s:116: 错误:operand 1 should be an integer register -- `mov r5,r0'
[build] /tmp/ccXshPqk.s:117: 错误:operand 1 should be an integer register -- `mov r4,r1'
[build] /tmp/ccXshPqk.s:119: 错误:unknown mnemonic `ldrexd' -- `ldrexd r0,r1,[r5]'
[build] /tmp/ccXshPqk.s:120: 错误:operand 1 should be a SIMD vector register -- `orr r6,r0,r4'
[build] /tmp/ccXshPqk.s:121: 错误:operand 1 should be a SIMD vector register -- `orr r7,r1,r2'
[build] /tmp/ccXshPqk.s:122: 错误:unknown mnemonic `strexd' -- `strexd r3,r6,r7,[r5]'
[build] /tmp/ccXshPqk.s:123: 错误:operand 1 should be an integer or stack pointer register -- `cmp r3,#0'
[build] /tmp/ccXshPqk.s:125: 错误:unknown mnemonic `pop' -- `pop {r4-r7}'
[build] /tmp/ccXshPqk.s:126: 错误:unknown mnemonic `bx' -- `bx lr'
[build] make[2]: *** [junction/turf/CMakeFiles/turf.dir/turf/c/impl/atomic_gcc_arm.c.o] Error 1
[build] make[2]: *** 正在等待未完成的任务....
[build] [ 25%] Building CXX object junction/turf/CMakeFiles/turf.dir/turf/extra/Random.cpp.o
[build] junction/turf/CMakeFiles/turf.dir/build.make:117: recipe for target 'junction/turf/CMakeFiles/turf.dir/turf/c/impl/atomic_gcc_arm.c.o' failed
[build] [ 28%] Building CXX object junction/CMakeFiles/junction.dir/junction/ConcurrentMap_Leapfrog.cpp.o
[build] [ 32%] Building CXX object junction/CMakeFiles/junction.dir/junction/QSBR.cpp.o
[build] [ 35%] Building CXX object junction/CMakeFiles/junction.dir/junction/ConcurrentMap_Linear.cpp.o
[build] [ 39%] Building CXX object junction/CMakeFiles/junction.dir/junction/details/Grampa.cpp.o
[build] [ 42%] Building CXX object junction/CMakeFiles/junction.dir/junction/details/Leapfrog.cpp.o
[build] [ 46%] Building CXX object junction/CMakeFiles/junction.dir/junction/details/Linear.cpp.o
[build] [ 50%] Building CXX object junction/CMakeFiles/junction.dir/junction/extra/MemHook_NBDS.cpp.o
[build] [ 53%] Building CXX object junction/CMakeFiles/junction.dir/junction/extra/MemHook_TBB.cpp.o
[build] [ 57%] Building CXX object junction/CMakeFiles/junction.dir/junction/striped/ConditionBank.cpp.o
[build] /tmp/cciSrMa7.s: Assembler messages:
[build] /tmp/cciSrMa7.s:47: 错误:unknown mnemonic `ldrex' -- `ldrex x4,[x0]'
[build] /tmp/cciSrMa7.s:50: 错误:unknown mnemonic `strex' -- `strex x6,x2,[x0]'
[build] junction/CMakeFiles/junction.dir/build.make:201: recipe for target 'junction/CMakeFiles/junction.dir/junction/striped/ConditionBank.cpp.o' failed
[build] CMakeFiles/Makefile2:143: recipe for target 'junction/CMakeFiles/junction.dir/all' failed
[build] make[2]: *** [junction/CMakeFiles/junction.dir/junction/striped/ConditionBank.cpp.o] Error 1
[build] make[1]: *** [junction/CMakeFiles/junction.dir/all] Error 2
[build] make[1]: *** 正在等待未完成的任务....
[build] CMakeFiles/Makefile2:169: recipe for target 'junction/turf/CMakeFiles/turf.dir/all' failed
[build] Makefile:90: recipe for target 'all' failed
[build] make[1]: *** [junction/turf/CMakeFiles/turf.dir/all] Error 2
[build] make: *** [all] Error 2
[proc] The command: /usr/bin/cmake --build /tmp/junction-sample/build --config Debug --target all -j 6 -- exited with code: 2 and signal: null
[build] Build finished with exit code 2
Recently found that visual studio 2015 benefitted significantly from using the tbb malloc alternative.
Any support likely in turf?
The TL:DR bit
Other allocators claiming good multithread performance did not scale well with modest numbers of threads.
E.g 4 cores each with 10m individually heap allocated 450 byte objects.
Simultaneous map resets took 8 sec per core and 9 secs wall clock time.
Alternative allocators below had some variation but typically became so bad the best of the others was 11sec one core, 50 sec to complete four cores. Serialised and extra lock contention.
Note the test is not a great design and should be using pool allocation but it illustrates the huge differences in windows multithreaded allocator support.
I cant vouch for the rest of tbb but the allocator scaled well when tcmalloc jemalloc and hoard all failed to scale in vs2015.
I suspect the others lag behind because they may not yet implement the latest hooks needed in the new crt.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.