当前位置:网站首页>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
边栏推荐
- Jerry's more accurate determination of abnormal address [chapter]
- Let the LAN group use the remote device
- Differences among restful, soap, RPC, SOA and microservices
- 202. Happy number
- Strongest date regular expression
- Jerry's users how to handle events in the simplest way [chapter]
- Pycharm
- 1. Sum of two numbers (hash table)
- Deploy jar package
- 206. Reverse linked list (linked list)
猜你喜欢

【leetcode】199.二叉树的右视图

Ueditor -- limitation of 4m size of image upload component

Introduction to data analysis 𞓜 kaggle Titanic mission (III) - > explore data analysis

Deploy jar package

SQL Server cursor circular table data

Idea - indexing or scanning files to index every time you start

Jinglianwen technology - professional data annotation company and intelligent data annotation platform

Solution architect's small bag - 5 types of architecture diagrams

C language - custom type

A diary of dishes | 238 Product of arrays other than itself
随机推荐
Comparison and practice of prototype design of knowledge service app
RESTful和SOAP的区别
MapReduce compression
Leetcode22: bracket generation
How can swagger2 custom parameter annotations not be displayed
得到知识服务app原型设计比较与实践
Qinglong panel pull library command update [April 20, 2022] collection is not lost
Installing MySQL with CentOS / Linux
Jerry sometimes finds that the memory has been tampered with, but there is no exception. How should he find it? [chapter]
LeetCode 1249. Minimum remove to make valid parents - FB high frequency question 1
Can Jerry's AES 256bit [chapter]
How does the swagger2 interface import postman
景联文科技—专业数据标注公司和智能数据标注平台
Xshell+Xftp 下载安装步骤
Latex usage
Solve the problem of installing VMware after uninstalling
209. Subarray with the smallest length (array)
59、螺旋矩阵(数组)
Is the pointer symbol of C language close to variable type or variable name?
MySql常用语句