Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
将堆栈变量传递给 pthread_cleanup_push
我有一个使用文件描述符的线程并且必须close 取消时的文件描述符 伪代码如下所示 static void thread cleanup void args int fd int args close fd void thread void
c
pthreads
如何提供一系列交错线程来显示代码中断并且不提供完美的同步?
我知道下面的代码是做什么的 我知道为什么它是一个损坏的同步代码 因为它只有一个条件变量 而我们需要两个 但我不知道如何提供一系列交错线程来显示它不起作用 您能举例说明为什么此代码不起作用吗 1 cond t cond PTHREAD CON
c
locking
pthreads
mutex
mutualexclusion
哪个线程处理该信号?
我有 2 个线程 线程 1 和线程 2 我有信号配置SIGINT 每当SIGINT发生线程2应该处理该信号 为此我写了下面的程序 include
c
Linux
Multithreading
pthreads
signals
线程堆栈指针
在Linux 2 6 32 32中 有没有一种方法可以在a中以编程方式查找有关线程的以下信息pthreads程序 我需要 运行计数 堆栈指针 堆栈开始 结束 堆栈大小 堆栈使用情况 我猜是类似 ThreadX 的东西 但在程序中 谢谢 pt
c
pthreads
ThreadX
如何使 pthread_cond_timedwait() 对系统时钟操作具有鲁棒性?
考虑以下完全符合 POSIX 标准的源代码 include
time
pthreads
POSIX
clock
pthread_join 中的“状态”到底代表什么以及如何查询它
我想知道 pthread join 中的 status 参数到底是用来做什么的 int pthread join pthread t thread void status 我正在尝试利用它 但我无法理解它到底代表什么 根据文档 status
c
pthreads
当 C++ 线程退出时,内存是否保持分配状态?
我在 Linux 上使用 pthread 库 我在线程 A 中分配一个字符串 然后尝试在线程 B 中打印该字符串 但是 该字符串只是打印出空 我已经验证它在线程 A 中工作 注意 该字符串驻留在一个对象内 我怀疑该对象可能会被清理或重新实例
c
Multithreading
pthreads
程序接收到信号SIGPIPE,管道损坏
我写了一个基于posix套接字的客户端程序 该程序创建多个线程并且将锁定服务器 但是在 gdb 调试期间 程序给出了一个信息 错误 gdb n Program received signal SIGPIPE Broken pipe Swit
c
Sockets
GDB
pthreads
SIGPIPE
创建线程时有多少开销?
我刚刚回顾了一些非常糟糕的代码 通过创建一个新线程来在串行端口上发送消息的代码 以便为发送的每条消息在新线程中打包和组装消息 是的 对于每条消息 都会创建一个 pthread 正确设置位 然后线程终止 我不知道为什么有人会做这样的事情 但它
c
pthreads
POSIX
如何获取 std::thread() 的 Linux 线程 ID
我正在玩std thread我想知道如何获得新的线程IDstd thread 我不是在谈论std thread id而是给予线程的操作系统 ID 您可以使用pstree 这仅供我所知 并且仅针对 Linux 平台 不需要可移植 我可以像这样
c
Multithreading
C11
pthreads
将 Haskell 线程与内核线程进行比较 - 我的基准测试可行吗?
这实际上是我的大学项目 在我的文章中 我需要提供证据证明 Haskell 线程的创建速度比普通内核线程更快 我知道最好参考一些研究论文 但重点是我必须自己进行基准测试 这是我的想法 我用 C 使用 pthreads 和 Haskell 编写
Multithreading
Haskell
pthreads
pthread的调度方法?
由于没有显式调度 pthread 被调度为由内核以随机方式运行 pthread 库中是否定义了相同的调度方法 例如优先级 线程的优先级被指定为增量 该增量被添加到进程的优先级上 更改进程的优先级会影响该进程中所有线程的优先级 线程的默认优先
pthreads
unix
PHP/pthreads Thread 类不能使用数组?
我找到了一个 PECL pthreadThread不能使用数组对象 我该怎么做才能找到原因 代码示例 class my extends Thread public function construct this gt arr array t
php
Multithreading
pthreads
pthread_cond_signal 导致死锁
我有一个程序 当其中一个线程调用时会死锁pthread cond siganl 或广播 该问题在主程序中可以 100 重现 我无法弄清楚它出了什么问题 因此提取了调用 wait 和 signal 的代码段 然而 僵局cannot与提取的问题
c
Linux
Multithreading
pthreads
deadlock
使用用户定义或 python 命令序列的 C++ 线程不会在 gdb 异步模式下停止
我在嵌入式 powerpc 目标上使用 gdb 7 4 1 对使用 pthread 的多线程 C 程序执行一些分析 我的最终目标是使用 python 编写 gdb 脚本来自动化一些常见的分析功能 问题是 当我单独运行命令与在 gdb 用户定
python
Asynchronous
GDB
pthreads
powerpc
pthread 与 python VM 的回调
假设我有一个 python 脚本 它通过 ctypes 加载共享库 SL SL 设置了一个pthread T1 python 脚本通过 SL 配置回调 即 python 脚本通过引用 python 可调用项从 SL 调用函数 替代文本 ht
python
Linux
Multithreading
ctypes
pthreads
什么时候销毁 pthread 屏障是安全的?
如果我有一个初始化的 pthread barrier t 什么时候可以安全地销毁它 下面的例子安全吗 pthread barrier t barrier int rc pthread barrier wait b if rc PTHREAD
c
Multithreading
POSIX
pthreads
RedHat Enterprise Linux 5.3 及以上版本不正确支持 sem_timedwait?
我们在使用 pthreadsem timedwait 的 RedHat Enterprise Linux 系统上看到了奇怪的行为 仅 5 3 及以上版本才会出现此情况 当我们使用 sem init 在后台线程上创建信号量时 不会返回错误 当
c
Linux
pthreads
Semaphore
rhel5
创建线程之前的 Pthread 亲和性
在创建线程之前 我需要设置亲和力 线程到核心 例如 第一个线程到第一个核心 就像是KMP AFFINITY in OpenMP 是否可以 编辑 我以这种方式尝试 但不起作用 void DoWork void args int nr int
c
pthreads
Affinity
有没有办法链接linux的线程TID和pthread_t“线程ID”
在 Linux 上 线程由pthread t或 TID 我正在寻找这两种线程 id 之间的桥梁 given a pthread t我可以得到它吗TID 显然 https stackoverflow com questions 558469
Linux
pthreads
PID
«
1 ...
3
4
5
6
7
8
9
...17
»