当前位置:网站首页>pthread_ Why does self() repeat
pthread_ Why does self() repeat
2022-04-23 14:06:00 【JokerYourMemory】
Say first conclusion :
from pthread_self() Checked tid, Only unique in the process , Different processes may find the same tid.
cause :
Wrote a little program , The program will run as a main process fork There are two sub processes , Then the main process goes to sleep , After two sub processes are started , Also sleep .
There are four threads in total , During log observation, it is found that , For two subprocesses , they pthread_create Outgoing thread , It is called in the thread pthread_self() Print thread id, There are two of them , Then realize that it may not be the only one . Check it out , Someone explained earlier as follows :
explain :
“pthread_self yes posix Thread described ID( Not a real thread in the kernel id), Relative to the identification number of each process in the thread , For this process is the only , And in different processes , Per thread pthread_self() Maybe the return is the same .
and gettid What you get is the thread in the kernel ID”
Quote from :https://blog.csdn.net/weixin_43204126/article/details/98236147
版权声明
本文为[JokerYourMemory]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231401090664.html
边栏推荐
- Jmeter设置环境变量支持在任意终端目录输入jmeter直接启动
- STM32 learning record 0007 - new project (based on register version)
- org.apache.parquet.schema.InvalidSchemaException: A group type can not be empty. Parquet does not su
- Expression「Func「TSource, object」」 转Expression「Func「TSource, object」」[]
- mysql通过binlog文件恢复数据
- 帆软中根据分类进行汇总
- Indoor and outdoor map switching (indoor three-point positioning based on ibeacons)
- 容差分析相关的计算公式
- Chapter I review of e-commerce spike products
- 帆软报表设置单元格填报以及根据值的大小进行排名方法
猜你喜欢
Wechat applet obtains login user information, openid and access_ token
Nifi 快速安装及文件同步操作
Jmeter安装教程以及我遇到的问题的解决办法
帆软实现分页时第一行和最后两行冻结方式
1256: bouquet for algenon
VMware Workstation 无法连接到虚拟机。系统找不到指定的文件
查询2013年到2021年的数据,只查询到2020的数据,遇到了这个问题所进行的解决办法
Use of WiFi module based on wechat applet
微信小程序调用客服接口
帆软分割求解:一段字符串,只取其中某个字符(所需要的字段)
随机推荐
Call wechat customer service applet
websocket
Oracle-数据泵使用
Wechat applet obtains login user information, openid and access_ token
微信小程序基于udp协议与esp8266进行通信
DDT+Excel进行接口测试
mysql通过binlog文件恢复数据
Qt Designer怎样加入资源文件
Kettle -- control parsing
帆软之单元格部分字体变颜色
Node接入支付宝开放平台的沙箱实现支付功能
容差分析相关的计算公式
室内外地图切换(室内基于ibeacons三点定位)
Pycharm连接远程服务器并实现远程调试
Wechat applet positioning and ranging through low-power Bluetooth device (2)
可否把模板的头文件和源文件分开编译
生成随机高质量符合高斯分布的随机数
linux MySQL数据定时dump
1到100号的灯开关问题
帆软中根据分类进行汇总