[英]Is there any way to dedicate cpu cores exclusively for a process in Windows 10?
I want to dedicate some cpu cores exclusively for my real-time data streaming application because I want to ensure that this process is always running without context-switching. 我想专门为我的实时数据流应用程序专用一些CPU内核,因为我想确保此过程始终在没有上下文切换的情况下运行。 (Ensuring no application except my process running on that core)
(确保除我的进程在该核心上运行外,不确保其他应用程序)
It seems there's a working solution for Linux. 似乎有一个适用于Linux的解决方案。 Is there any way to do this for Windows 10?
Windows 10有什么方法可以做到这一点?
Any solution will be greatly appreciated. 任何解决方案将不胜感激。
(I've thought about setting process affinity in task manager. But to dedicate cpu cores(for example only core 1) exclusively for my process, I have to uncheck core 1 in process affinity window for all processes, and only check core 1 for my process. However, this solution is too tedious physical labor and seems hard to do it programmatically.) (我曾考虑过在任务管理器中设置进程亲和力。但是要专门为我的进程指定cpu内核(例如,仅内核1),我必须在所有进程的进程亲和力窗口中取消选中核心1,并仅针对我的过程。但是,这种解决方案太麻烦了,体力劳动,似乎很难以编程方式完成。)
您可以使用WIN32 API SetProcessAffinityMask()设置进程关联。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.