Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
并发链表
我正在尝试用 C 设计一个允许并发访问的链表 显然 对该列表使用单个锁的效率非常低 因为不相交的区域可能会并行更新 现在除了为每个节点存储一个锁之外我还有什么选择 另外 在这种情况下 非阻塞版本会是更好的选择吗 有相关链接吗 EDIT 谢谢
c
Multithreading
pthreads
空堆区域的开销
我的工具是 Linux gcc 和 pthreads 当我的程序从多个线程调用 new delete 时 并且存在堆争用时 会创建 arena 请参阅 以下链接以供参考 http www bozemanpass com info linux
c
Linux
pthreads
heapmemory
编码风格:锁定/解锁内部还是外部?
另一个可能愚蠢的问题 并发应该如何锁定 执行者或调用者应该负责锁定线程吗 例如没有特定的语言 Caller callAnotherThread executor method Executor method lock doSomething
codingstyle
locking
pthreads
Objectivec
POSIX 取消点应该如何表现?
我一直在研究 glibc nptl 取消点的实现 并将其与 POSIX 进行比较 除非我弄错了 否则它是完全错误的 使用的基本模型是 int oldtype LIBC ASYNC CANCEL switch to asynchronous
c
Linux
pthreads
POSIX
glibc
pthread 中的信号处理
我创建了一个 pthread 并在其中安装了一个信号处理程序 与我们在中所做的方式相同main 功能 线程的信号处理程序是一个单独的函数 令人惊讶的是 它不起作用 即线程的信号处理程序无法捕获信号 这是代码 include
c
pthreads
signals
基本互斥锁和原子整数哪个更有效?
对于像计数器这样简单的东西 如果多个线程会增加数量 我读到互斥锁会降低效率 因为线程必须等待 所以 对我来说 原子计数器是最有效的 但我读到在内部它基本上是一个锁 所以我想我很困惑为什么其中一个比另一个更有效 原子操作利用处理器支持 比较和
Multithreading
operatingsystem
pthreads
mutex
atomic
有没有办法在线程创建/销毁时调用库线程本地初始化/清理?
这个问题类似于如何在线程创建和退出时调用函数 https stackoverflow com questions 42229612 how to call a function on a threads creation and exit但
c
Multithreading
pthreads
threadlocalstorage
futex
POSIX 线程在 Linux 上是如何实现的?
我想知道通过 pthreads 库创建的线程实际上是内核级线程还是与内核无关的用户空间线程 我听到过对此相互排斥的意见 所以我想知道真相 在 Linux 2 6 之前 它们本质上是用户空间线程 是粘合在一起的独立进程 因为内核没有真正的线程
Linux
Multithreading
pthreads
ENOMEM创建线程失败的原因?
我有一个正在使用的应用程序pthread create and pthread detach 在主线程和稍后pthread exit 在子线程中 54 左右后pthread create 每个调用都与后续的调用配对pthread detac
c
memoryleaks
64bit
pthreads
Centos5
在Linux上编写多线程TCP服务器
在工作中 我的任务是实现 TCP 服务器作为 Modbus 从设备的一部分 我在堆栈交换和互联网上读了很多书 包括优秀的http beej us guide bgnet http beej us guide bgnet 但我正在努力解决设计
c
Linux
Multithreading
Sockets
pthreads
fork(应该是)对于线程程序中的信号处理程序来说是安全的吗?
我真的不确定 POSIX 对安全性的要求fork在存在线程和信号的情况下 fork被列为异步信号安全函数之一 但如果库代码可能已注册pthread atfork处理程序不是异步信号安全的 这是否否定了安全性fork 答案是否取决于运行信号处
c
pthreads
deadlock
fork
signals
在终止的线程上调用 pthread_cancel() 是否安全?
我想知道打电话是否安全pthread cancel 在已终止的线程上 我在手册页中找不到任何提示 预先感谢您的任何提示 编辑 也许我不够准确 我是not谈论的是由较早的 pthread cancel 终止的线程 而是谈论只是从其线程函数返回
c
pthreads
POSIX
pthreads:快速重新锁定导致的线程饥饿
我有两个线程 一个在紧密循环中工作 另一个偶尔需要与第一个线程执行同步 thread 1 while 1 lock work perform work unlock work thread 2 while 1 unrelated work
c
Multithreading
pthreads
为什么线程过程应该是静态的或成员函数
为什么线程过程应该是静态的或成员函数 有什么正当理由吗 非静态成员变量有一个隐式的this编译器内部传递的参数 You have ClassInQuestion void threadFunc int 并且编译器内部创建了一个函数 void
c
visualc
MFC
pthreads
仅使用互斥锁实现读/写锁?
我试图仅使用互斥锁来实现读 写锁 仅供学习 正当我以为我已经涵盖了所有极端情况 因为程序可以处理各种组合 时 我意识到 我忽略了一个事实 因为它在 ubuntu 中工作 互斥体应该由线程的所有者释放 下面是我的实现 class rw loc
c
Multithreading
pthreads
mutex
向条件变量发出信号(pthreads)
假设某个条件变量 cond 与互斥变量 mutex 相关联 如果一个线程正在休眠cond打电话后pthread cond wait cond mutex 另一个线程有mutex锁定完毕 该线程是否调用有关系吗pthread cond sig
c
pthreads
POSIX
mutex
conditionvariable
PHP Pthreads 最新版本 3.1.6(64 位)未安装在 Apache 上
我正在尝试为 PHP 安装最新的 pthreads 扩展 3 1 6 64 位 根据 pthreads 的作者建议 http github com krakjoe pthreads http github com krakjoe pthre
php
Windows
apache
dll
pthreads
如何在 Linux 中分析 pthread 互斥体?
我想知道如何分析 pthread 互斥体以查看我的代码中是否存在任何锁定争用点 谁喜欢有争议的代码 对吧 正如我提到的 我知道如何对代码进行更一般的分析here https stackoverflow com a 10800412 1158
c
performance
pthreads
mutex
C++ 11 线程,错误调用纯虚函数
这是我正在尝试编译的一个非常小的 C 11 Thread API 代码 include
c
Multithreading
C11
pthreads
beagleboneblack
将 pthread 变量保留为本地变量
使用时有没有办法pthread h在 Linux GCC 上将变量保留为线程函数的本地变量 int i 42 global instance of i int main pthread t threads 2 long t pthread
c
Linux
pthreads
POSIX
«
1 ...
8
9
10
11
12
13
14
...18
»