c++ - Windows C++ : Prioritizing threads to prevent main thread being preempted

标签 c++ windows multithreading visual-studio

有没有办法让 Window 的任务调度程序知道我的工作线程没有主线程那么紧急,以便它可以选择先中断它们?我遇到了一些麻烦,因为我的主线程经常被抢占,这减慢了它向其他线程委派任务的能力。

最佳答案

看看 SetThreadPriority() Win32 API 中的函数。

关于c++ - Windows C++ : Prioritizing threads to prevent main thread being preempted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55031669/

相关文章:

ios - 使用 Grand Central Dispatch (GCD) 时获取 OSSpinLockLock

c++ - 位置.hh :46: error: expected unqualified-id before ‘namespace’

c++ - 如何将 vtkDoubleArray 转换为 Eigen::matrix

c++ - strcat 两次添加第二个参数

Python线程: Queue workers - hang the program

java - SQLite VACUUM 命令

C++ 找不到兼容的标准构造函数

c++ - 为什么 MSVC++11 拒绝函数的 constexpr 限定?

windows - 如何手动创建可执行的 .exe PE 文件?

python - 如何在 Python 中执行 Curl