Android NDK and pthread
2016-05-27 09:27
429 查看
http://stackoverflow.com/questions/11048260/does-android-support-thread
Does Android support pthreads?And why when i use -pthread option i see the linker error:
-----------------------------------------
As far as I could see in the docs you do not need to use "-pthread". Checkout following:
http://mobilepearls.com/labs/native-android-api/#pthreads
----------
and condition variables as well as other more advanced features. Read the bionic
OVERVIEW.txt for more information.
TLS, thread-local storage, is limited to 59
pthread_key_t slots available to applications, lower than the posix minimum of 128.
----------
Info from NDK offical docs states (android-ndk-r8\docs\system\libc\OVERVIEW.html):
So keep in mind that Bionic includes directly pthread as opposed to standard way you are used to (with -lpthread).
Does Android support pthreads?And why when i use -pthread option i see the linker error:
-----------------------------------------
As far as I could see in the docs you do not need to use "-pthread". Checkout following:
http://mobilepearls.com/labs/native-android-api/#pthreads
----------
POSIX threads (pthreads)
The android libc, bionic, provides built-in support for pthreads, so no additional linking (-lpthreads) is necessary. It does not implement full POSIX threads functionality and leaves out support for read/write locks, pthread_cancel(), process-shared mutexesand condition variables as well as other more advanced features. Read the bionic
OVERVIEW.txt for more information.
TLS, thread-local storage, is limited to 59
pthread_key_t slots available to applications, lower than the posix minimum of 128.
----------
Info from NDK offical docs states (android-ndk-r8\docs\system\libc\OVERVIEW.html):
PThread implementation: Bionic's C library comes with its own pthread implementation bundled in. This is different from other historical C libraries which: - place it in an external library (-lpthread) - play linker tricks with weak symbols at dynamic link time
So keep in mind that Bionic includes directly pthread as opposed to standard way you are used to (with -lpthread).
相关文章推荐
- Android基础知识:android新特性
- Android之内存优化(一)
- Android 利用工具实现一键自动findViewById功能
- android环境下两种md5加密方式
- Android 6.0+ 运行时权限探索
- 【Android 基础】Animation 动画介绍和实现
- Android中的Layout_weight(权重)详解
- Android带侧滑菜单的列表
- Android绘图机制与处理技巧(二)——Android图像处理之色彩特效处理
- android studio获取sha1值
- 推荐给Android开发者的抢手书单
- Activity的启动模式
- Android 列表播放视频和浮动播放窗口
- android 调用系统相机
- Android AutoComplate
- Android绘制图形(重绘方法在此可以找到)
- Android List Adapter
- 关于android complication的官方文档
- how to run an android emulator in ubuntu 14.04
- XposedHook:hook敏感函数