当前位置:网站首页>How to bind a process to a specified CPU
How to bind a process to a specified CPU
2022-04-23 10:48:00 【A dazed caddie】
// Bind the current process to cpu0 perform
cpu_set_t mask;
CPU_ZERO(&mask); // take CPU Set empty
CPU_SET(0,&mask);// take CPU0 Join in CPU focus
if(sched_setaffinity(getpid(), sizeof(cpu_set_t), &mask) == -1) // Link the current process to CPU Set binding
{
printf("warning: could not set CPU affinity, continuing...\n");
}
Reference material :
https://blog.csdn.net/wangquan1992/article/details/104860237
https://www.linuxidc.com/Linux/2015-04/116867.htm
https://mp.weixin.qq.com/s/inKtafw7reHmRqhwvcxi9w
版权声明
本文为[A dazed caddie]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230618290946.html
边栏推荐
- Anaconda3 installation
- 主流手机分辨率与尺寸
- Precautions for latex formula
- What about Jerry's stack overflow? [chapter]
- Leetcode22: bracket generation
- 解决方案架构师的小锦囊 - 架构图的 5 种类型
- 349. Intersection of two arrays
- 242、有效字母异位词(哈希表)
- Example of pop-up task progress bar function based on pyqt5
- SSH uses private key to connect to server without key
猜你喜欢
Comparison and practice of prototype design of knowledge service app
Six practices of Windows operating system security attack and defense
得到知识服务app原型设计比较与实践
Charles function introduction and use tutorial
中职网络安全2022国赛之CVE-2019-0708漏洞利用
Sim Api User Guide(6)
Yarn core parameter configuration
MapReduce core and foundation demo
Manjaro installation and configuration (vscode, wechat, beautification, input method)
第120章 SQL函数 ROUND
随机推荐
精彩回顾 | DEEPNOVA x Iceberg Meetup Online《基于Iceberg打造实时数据湖》
Strongest date regular expression
域名和IP地址的联系
202. Happy number
IDEA——》每次启动都会Indexing或 scanning files to index
Comparison and practice of prototype design of knowledge service app
Let the LAN group use the remote device
Esp32 learning - use and configuration of GPIO
997、有序数组的平方(数组)
19、删除链表的倒数第N个节点(链表)
Diary of dishes | Blue Bridge Cup - hexadecimal to octal (hand torn version) with hexadecimal conversion notes
Image processing - Noise notes
209. Subarray with the smallest length (array)
Jerry's more accurate determination of abnormal address [chapter]
How can swagger2 custom parameter annotations not be displayed
Restful、SOAP、RPC、SOA、微服务之间的区别
203. Remove linked list elements (linked list)
SQLServer 查询数据库死锁
全栈交叉编译X86完成过程经验分享
Chapter 120 SQL function round