pthread_create函数创建线程失败的原因
2017-06-07 20:54
435 查看
自己在arm上进行测试,pthread_create函数竟然出错了,有点吃惊。自己百度后明白,是因为线程资源的问题:没有进行资源的回收。
可是自己确定自己的代码在这一块没有出现问题,找了好久发现,有可能是自己arm板子上的资源不足了,自己通过ulimit -s 来设置线程默认栈空间大小,编译通过了。
原来真是资源不足呀!
linux下pthread_attr_setstacksize函数,是可以设置线程默认栈空间的大小的,以后自己在好好了解吧,现在这里记下吧。
ps:自己在开发板进行打开音频设备,老是显示资源或者设备busy,原来是资源被占用,自己可以在linux设置混音配置,然后问题解决了。
可是自己确定自己的代码在这一块没有出现问题,找了好久发现,有可能是自己arm板子上的资源不足了,自己通过ulimit -s 来设置线程默认栈空间大小,编译通过了。
原来真是资源不足呀!
linux下pthread_attr_setstacksize函数,是可以设置线程默认栈空间的大小的,以后自己在好好了解吧,现在这里记下吧。
ps:自己在开发板进行打开音频设备,老是显示资源或者设备busy,原来是资源被占用,自己可以在linux设置混音配置,然后问题解决了。
相关文章推荐
- 线程的创建pthread_create()函数(线程一)
- 线程创建函数pthread_create
- 对线程创建函数pthread_create的总结
- pthread_create是类Unix操作系统(Unix、Linux、Mac OS X等)的创建线程的函数。
- 线程创建函数pthread_create的pthread_attr_t类型的参数
- 使用pthread_create创建大量线程时,创建线程失败,Resource temporarily unavailable的解决办法
- linux 线程创建函数pthread_create的几个传参方式
- linux 线程创建函数pthread_create的几个传参方式
- pthread_create()创建线程最大个数
- pthread_create线程创建的过程剖析
- 关于pthread_create创建线程, 产生segment错误。
- 线程退出【Linux学习】pthread_create主线程与创建的新线程之间退出关系
- Linux下多线程编程__线程的创建pthread_create与退出pthread_exit,等待当前线程退出pthread_join,获取线程ID pthread_self
- 编写线程函数时,链接时报错:undefined refrence to 'pthread_create '
- pthread_create()给创建的线程传递参数
- pthread_create线程创建的过程剖析(转)
- pthread_create主线程与创建的新线程之间退出关系
- pthread_create线程创建的过程剖析
- pthread线程创建出现undefined reference to `pthread_create' collect2: error: ld returned 1 exit status
- linux创建线程失败的原因是线程栈大小的设置