Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncnn 支持多线程吗? #609

Closed
ronyuzhang opened this issue Oct 15, 2018 · 4 comments
Closed

ncnn 支持多线程吗? #609

ronyuzhang opened this issue Oct 15, 2018 · 4 comments

Comments

@ronyuzhang
Copy link

No description provided.

@ronyuzhang
Copy link
Author

在安卓上, 我把包含native方法的对象传给线程,在线程中进行detection的操作, 不过会报错

@ronyuzhang
Copy link
Author

error as follows:

2018-10-15 23:33:58.824 30890-30931/com.example.mm.mobilenetssd A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 30931 (Thread-6)
2018-10-15 23:33:58.901 31185-31185/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2018-10-15 23:33:58.901 31185-31185/? A/DEBUG: Build fingerprint: 'Android/sl3399/sl3399:7.1.2/NHG47K/pengbi08140945:userdebug/test-keys'
2018-10-15 23:33:58.901 31185-31185/? A/DEBUG: Revision: '0'
2018-10-15 23:33:58.901 31185-31185/? A/DEBUG: ABI: 'arm'
2018-10-15 23:33:58.901 31185-31185/? A/DEBUG: pid: 30890, tid: 30931, name: Thread-6 >>> com.example.zhangyao.mobilenetssd <<<
2018-10-15 23:33:58.902 31185-31185/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2018-10-15 23:33:58.902 31185-31185/? A/DEBUG: r0 00000000 r1 000078d3 r2 00000006 r3 00000008
2018-10-15 23:33:58.902 31185-31185/? A/DEBUG: r4 bdb94978 r5 00000006 r6 bdb94920 r7 0000010c
2018-10-15 23:33:58.902 31185-31185/? A/DEBUG: r8 bdb93d0c r9 bdb93aa8 sl 00030005 fp ca8522d8
2018-10-15 23:33:58.902 31185-31185/? A/DEBUG: ip 0000000b sp bdb93a18 lr eeb2a5f7 pc eeb2ce54 cpsr 20050010
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: backtrace:
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #00 pc 00049e54 /system/lib/libc.so (tgkill+12)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #1 pc 000475f3 /system/lib/libc.so (pthread_kill+34)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #2 pc 0001d8a5 /system/lib/libc.so (raise+10)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #3 pc 000193f1 /system/lib/libc.so (__libc_android_abort+34)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #4 pc 00017034 /system/lib/libc.so (abort+4)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #5 pc 0008ec17 /data/app/com.example.zhangyao.mobilenetssd-1/lib/arm/libnative-lib.so (__kmp_abort_process+30)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #6 pc 0008a11d /data/app/com.example.zhangyao.mobilenetssd-1/lib/arm/libnative-lib.so (__kmp_msg+300)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #7 pc 000934ed /data/app/com.example.zhangyao.mobilenetssd-1/lib/arm/libnative-lib.so (_Z30__kmp_register_library_startupv+340)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #8 pc 0008dd99 /data/app/com.example.zhangyao.mobilenetssd-1/lib/arm/libnative-lib.so
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #9 pc 0008dd5b /data/app/com.example.zhangyao.mobilenetssd-1/lib/arm/libnative-lib.so (__kmp_get_global_thread_id_reg+90)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #10 pc 0007e5fd /data/app/com.example.zhangyao.mobilenetssd-1/lib/arm/libnative-lib.so (__kmpc_fork_call+32)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #11 pc 0001c635 /data/app/com.example.zhangyao.mobilenetssd-1/lib/arm/libnative-lib.so
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #12 pc 00019c9b /data/app/com.example.zhangyao.mobilenetssd-1/lib/arm/libnative-lib.so (Java_com_example_zhangyao_mobilenetssd_SSDNcnn_DetectV2+146)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #13 pc 000ae399 /system/lib/libart.so (art_quick_generic_jni_trampoline+40)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #14 pc 000a99c1 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #15 pc 00405281 /system/lib/libart.so (art_quick_invoke_stub+232)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #16 pc 000b0c55 /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+136)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #17 pc 001ed0d5 /system/lib/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+200)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #18 pc 001e7685 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+492)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #19 pc 003fccb7 /system/lib/libart.so (MterpInvokeVirtual+430)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #20 pc 0009c814 /system/lib/libart.so (ExecuteMterpImpl+14228)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #21 pc 001ca9af /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+290)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #22 pc 001cf481 /system/lib/libart.so (_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameE+92)
2018-10-15 23:33:58.914 31185-31185/? A/DEBUG: #23 pc 003f4787 /system/lib/libart.so (artQuickToInterpreterBridge+706)
2018-10-15 23:33:58.915 31185-31185/? A/DEBUG: #24 pc 000ae413 /system/lib/libart.so (art_quick_to_interpreter_bridge+34)
2018-10-15 23:33:58.915 31185-31185/? A/DEBUG: #25 pc 000a99c1 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
2018-10-15 23:33:58.915 31185-31185/? A/DEBUG: #26 pc 00405281 /system/lib/libart.so (art_quick_invoke_stub+232)
2018-10-15 23:33:58.915 31185-31185/? A/DEBUG: #27 pc 000b0c55 /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+136)
2018-10-15 23:33:58.915 31185-31185/? A/DEBUG: #28 pc 00315e81 /system/lib/libart.so (_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_8ArgArrayEPNS_6JValueEPKc+56)
2018-10-15 23:33:58.915 31185-31185/? A/DEBUG: #29 pc 00316c4d /system/lib/libart.so (_ZN3art35InvokeVirtualOrInterfaceWithJValuesERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDP6jvalue+256)
2018-10-15 23:33:58.915 31185-31185/? A/DEBUG: #30 pc 0032dddd /system/lib/libart.so (_ZN3art6Thread14CreateCallbackEPv+848)
2018-10-15 23:33:58.915 31185-31185/? A/DEBUG: #31 pc 000470c3 /system/lib/libc.so (_ZL15__pthread_startPv+22)
2018-10-15 23:33:58.915 31185-31185/? A/DEBUG: #32 pc 00019e3d /system/lib/libc.so (__start_thread+6)
2018-10-15 23:
@nihui

@JSnobody
Copy link

JSnobody commented Nov 5, 2018

我记得是支持的

@nihui
Copy link
Member

nihui commented Nov 19, 2018

支持的,ncnn repo 里的 squeezencnn 例子用了多线程

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants