相关疑难解决方法(0)

为什么以及在什么意义上 pthread_t 是不透明类型?

SO 上的帖子表明这pthread_t是一种不透明类型,不是数字,当然不是线程索引,您不应该直接比较pthread_t's 等。

问题:

  1. 为什么?是否真的打算支持没有线程数字 ID 的系统?当pthread_t实现很简单

    typedef unsigned long int pthread_t;
    
    Run Code Online (Sandbox Code Playgroud)

    ?

  2. 如何?上面一行之前有一个注释,所以它实际上是

    /* Thread identifiers. The structure of the attribute type is not
       exposed on purpose.  */
    typedef unsigned long int pthread_t;
    
    Run Code Online (Sandbox Code Playgroud)

    pthreadtypes.h这是什么意思?什么属性类型?这不是某个全局线程表的索引吗?

c multithreading pthreads

5
推荐指数
2
解决办法
3014
查看次数

标签 统计

c ×1

multithreading ×1

pthreads ×1