腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(5998)
视频
沙龙
2
回答
创建/分配p_threads数组
c
、
arrays
、
multithreading
、
struct
、
pthreads
所以我的步骤是: 1.创建指向pthread结构数组的指针(用户输入的大小可变) 2.分配pthread结构的数组3.为每个数组位置创建pthread
pthread_t
* pthreadArray[userInputSize];但我得到一个错误: incompatibletypes when assigning to type '
pthread_t
*[(size type)(userInpu
浏览 1
提问于2015-03-24
得票数 0
1
回答
在地图中使用
pthread_t
作为键
c++
、
linux
、
multithreading
、
pthreads
、
posix
我想在映射中存储一个我自己的类,键的类型是
pthread_t
。(我的类的每个对象都包含一个
pthread_t
数据成员,所以我希望每个实例在映射中作为键与该
pthread_t
关联)问题是
pthread_t
不能与pthread_equal进行比较,所以我不能将它作为键放在映射中我见过unordered_map,但是我如何为
pthread_t
实现散列函数呢?到目前为止,我考虑过使用pthread_self()来比较它们,但这也是不可能的,因为返回值是
pthread_t
,而且我不想使用这只是一个
浏览 1
提问于2016-04-10
得票数 0
1
回答
使用vector<
pthread_t
>::iterator创建和连接p线程
c++
、
pointers
、
vector
、
pthreads
、
pthread-join
错误是: void *returnValue; for (vector<
浏览 1
提问于2016-04-26
得票数 0
回答已采纳
1
回答
C- pthread_join()挂起(有时)
c
、
multithreading
、
gcc
、
pthreads
) { exit(1);
pthread_t
浏览 2
提问于2016-05-22
得票数 4
回答已采纳
1
回答
编译错误将无效操作数编译为二进制&& (具有'int‘和'
pthread_t
’{又名'struct <anonymous>'})
c
、
compiler-errors
我正在尝试编译一些C代码,我得到了这个错误有问题的代码是 /* Kill the mining threads*/
pthread_t
浏览 4
提问于2020-12-04
得票数 0
1
回答
pthread_join导致分段错误。为什么?
c
、
multithreading
、
thread-safety
、
pthreads
、
segmentation-fault
Array of file names */ int num_images, *threads_ids /*threads ids*/; return -1; threads = (
pthread_t
*) malloc(num_images +
浏览 3
提问于2010-12-06
得票数 4
回答已采纳
1
回答
pthread_create更改数组的值
c
、
multithreading
0; i < threadNumber; i++){ pthread_create(sons + sizeof(
pthread_t
浏览 1
提问于2015-06-22
得票数 1
回答已采纳
1
回答
pthread指针数组
c
、
pointers
、
pthreads
typedef struct {
pthread_t
*threads[MAX_STREAM_COUNT];当我想开始阅读的时候
浏览 0
提问于2012-07-04
得票数 0
回答已采纳
3
回答
pthread_t
指针作为pthread_create的参数
c
、
pointers
、
pthreads
pthread_create的第一个参数是一个
pthread_t
指针。在下面的hello程序中,如果第一个参数是指向
pthread_t
(
pthread_t
*)的指针,而不是
pthread_t
(
pthread_t
),则程序以
pthread_t
结尾 要创建线程,必须声明一个类型为
pthread_t
而不是
pthread_t
*的变量。但是 -- pthread
浏览 1
提问于2012-12-19
得票数 3
回答已采纳
1
回答
是否可以确定
pthread_t
结构是否未使用?
c
、
struct
、
pthreads
是否可以确定我声明的
pthread_t
结构是否未使用?我有一个
pthread_t
结构数组,在程序结束时,我会对每个结构调用pthread_join(),但如果其中一些从未使用过,我就不想对它们调用pthread_join()。判断
pthread_t
结构是否未使用的最好方法是什么?
浏览 0
提问于2012-04-23
得票数 1
回答已采纳
1
回答
如何创建一个可变数量的线程?
c
、
multithreading
、
pthreads
我在大学时的编程作业的一部分指定:
pthread_t
*pthreadArray = malloc(sizeof(
pthread_t
) * userInputSize);
pthread_t
*pthreadArray = malloc(sizeof(<e
浏览 1
提问于2019-11-01
得票数 2
3
回答
删除
pthread_t
*
c++
、
pthreads
谢谢args var;var.matrixB=matrixB; var.matrixC
浏览 1
提问于2012-10-28
得票数 0
回答已采纳
1
回答
在
pthread_t
是数字的平台上,0保证是无效的值吗?
c++
、
pthreads
pthread_t
(由pthread_self()返回)是一种不透明类型,但在某些平台上实际上是数字类型,例如typedefed to unsigned long。在这些平台上,0是一个无效的
pthread_t
值吗?那-1呢
浏览 5
提问于2013-08-23
得票数 0
回答已采纳
3
回答
便携打印和比较
pthread_t
c++
、
multithreading
、
posix
、
portability
我真正需要的是可移植的比较和打印*nix pthread标识符(
pthread_t
)。pthread_equal函数用于比较两个线程id是否相等,但是不能将它们与运算符< <= >= >(当然是可移植的)进行比较,因为在某些实现中,
pthread_t
是指向结构的指针。如果需要比较两个线程ids,只需调用但是对于运算符<我们使用散列进行比较 hash<
pthread_t
>::calculate(tid1) < hash<
pth
浏览 2
提问于2011-01-22
得票数 1
3
回答
pthreads中
pthread_t
的数据类型?
c
、
pthreads
、
64-bit
我有一个32位的代码,其中int用来代替
pthread_t
?所以在移植时,我需要在LP64 (64位)中改成long。
pthread_t
的数据类型是什么?
浏览 4
提问于2015-03-30
得票数 3
1
回答
在调用pthread_create时分割错误,传递一个结构
c
、
pthreads
rows and columns (one value)\n");
pthread_t
* threadArr = (
pthread_t
*) malloc(p*sizeof(
pthread_t
)); forinputArray[i].localmax = localmax;
浏览 2
提问于2017-04-23
得票数 0
回答已采纳
1
回答
如何对句柄已动态创建的线程执行pthread_join操作
c
、
linux
、
multithreading
、
posix
void *threadHandle;我不能按价值创造句柄。正在成功地创建线程。start_routine)(void *), void *args) printf("Thread Creation Started \n"); int returnValue =
浏览 1
提问于2022-06-23
得票数 0
2
回答
线程程序中的意外分割故障
c
functionThread, &total);In file included from assn3.c:12:0: extern int pthread_join (
pthread_t
__th, void **__thread_returnn", MAX_NUMBERS);
浏览 1
提问于2016-02-27
得票数 1
1
回答
linux获取此进程启动的所有线程
c++
、
linux
、
pthreads
在Linux中,使用C++,有没有办法以编程的方式获得这个进程已经启动的所有
pthread_t
的列表?
浏览 1
提问于2015-03-21
得票数 0
1
回答
将
pthread_t
传递给函数时出现奇怪的错误
c
、
multithreading
、
pthreads
我有一个C头文件,它定义了以下函数:这是由另一个函数定义的:...当我编译时,它说:你知道我做错了什么吗?
浏览 1
提问于2009-11-09
得票数 2
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
linux多线程服务器
Java线程映射到操作系统线程原理浅析
Redis单线程不行了,快来割VM/ BIO/ IO多线程的韭菜!(附源码)
C语言服务器编程必备常识
西瓜视频稳定性治理体系建设二:Raphael 原理及实践
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券