- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
最近在使用 Linux 内核的工作队列时,我发现了一些我不确定它是什么的东西(“CPU 死机”),甚至用谷歌搜索也不确定。
这是否意味着特定的 CPU 内核当前不可用或类似的东西?
以下是我要问的问题的上下文(full-version):
/**
* queue_work - queue work on a workqueue
* @wq: workqueue to use
* @work: work to queue
*
* Returns %false if @work was already on a queue, %true otherwise.
*
* We queue the work to the CPU on which it was submitted, but if the CPU dies
* it can be processed by another CPU.
*/
static inline bool queue_work(struct workqueue_struct *wq,
struct work_struct *work)
{
return queue_work_on(WORK_CPU_UNBOUND, wq, work);
}
最佳答案
Per-cpu 工作队列通常是首选,因为它们往往表现出更好的性能。
工作队列在一个 CPU 上提交,但如果此 CPU 进入 IDLE,则工作队列将移动到另一个 CPU。
如果工作队列(每个工作人员一个工作队列)为空,工作人员将进入空闲状态。
Each worker-pool bound to an actual CPU implements concurrency management by hooking into the scheduler. The worker-pool is notified whenever an active worker wakes up or sleeps and keeps track of the number of the currently runnable workers. Generally, work items are not expected to hog a CPU and consume many cycles. That means maintaining just enough concurrency to prevent work processing from stalling should be optimal. As long as there are one or more runnable workers on the CPU, the worker-pool doesn’t start execution of a new work, but, when the last running worker goes to sleep, it immediately schedules a new worker so that the CPU doesn’t sit idle while there are pending work items. This allows using a minimal number of workers without losing execution bandwidth.
参见 here
关于c - "CPU dies"(与硬件无关)是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57112155/
假设我们要描述一个满足以下真值表的组合电路: a b | s0 s1 s2 s3 ----------------- 0 0 | 1 d d d 0 1 | 0 1 d d 1 0 |
.mainIDv { height:300px; width:400px; padding:5px; margin: 8px auto 8px auto; } .ImgDisp{
我的 iOS 应用程序遇到了一个恼人的问题。突然,当我启动带有 TableView 的 View Controller 时,出现以下错误: Unrecognized selector sent to
我有一个简单的 PreferenceActivity 类,它的 onCreate 将我的 R.xml.preferences 屏幕传递给 ((PreferenceActivity)super).add
在大学项目范围内,我应该实现数据库的聚合。 我得到了一个实体关系模型,它看起来与此类似: 现在我应该实现一个 SQL 脚本来创建这样的数据库,但我在谷歌或其他任何地方找不到有关此主题的任何内容。在我教
我一直在努力阅读 GCD 并试图弄明白。我读了很多地方,应该始终使用 GCD,如果一个人正在做一些繁重的工作,这会卡住 UI,我确实理解这一点,但是 GCD 也可以仅仅为了性能而使用吗?假设我有一个循
当有人用他们自己的类重载线程时,这个问题似乎已经以一种或另一种形式得到了回答,但是如果只是尝试使用 QTimer 类而不扩展 QThread 类呢?我正在尝试将 QTimer 用于 QT。他们在 上的
在网上看了类似的问题/错误,没有一个对我有帮助... 未处理的拒绝 SequelizeEagerLoadingError:任务未关联到用户! 我的用户路线 router.get('', functio
如果我正在评估两个变量而不是两个方法调用,那么我使用“&&”或“&”是否重要 //some logic that sets bool values boolean X = true; boolean
我们目前正在内部为我们的项目使用 Oracle 10g,这不太可能改变,但最终我们将向其他客户提供此应用程序,我们需要能够提出替代的免费数据库。 那么使 Hibernate 持久层独立于所使用的底层
我的 AsyncTask 类中的 onPostExecute() 方法有问题。 我有一个SignupActivity: public class SignupActivity extends AppC
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
我一直在大量关注 sequelize 的文档,但在处理关系时遇到了问题。这是我使用 belongsTo 创建两个非常基本的 1:1 关系的非常简单的代码 import Sequelize, { STR
我希望这与 GMT 无关,否则我会觉得自己很愚蠢。 2 个快速相关的问题。为什么这会转换为不同的日期?正在失去一天。我查看了其他答案中所述的时区,但它始终是 GMT 时区 0000,这正是我所期望的。
我发现了这个问题的很多版本,但似乎都没有比明显的 Google Chrome 错误更进一步。 发生的情况是,每当我将 codeigniter 设置复制到服务器上的新文件夹,以基于它启动新项目时,我在尝
我需要一个与 UI 无关的简单布局管理器。通过这个,我的意思是它不应该指定我想如何在屏幕上表示我的形状/控件。它应该能让我说: 我想要 X 形状。我想要 X 形下的 Y 形。我希望形状 Z 包围 X,
当有一个方法== , 方法 !=被定义为采用该结果并应用 !给它。 (可能还有 =~ 和 !~ 。) 与此不同,>= , 通常表示 >或 == , 实际上独立于 >和 == .这两个定义似乎都不会影响
我在 Ruby Netbeans 6.5.1 中获得了大量(我称之为)无关的自动完成信息。 例如,如果我输入一个模型对象的名称,然后输入一个句点(无论我是在 Controller 中还是在 View
我是 NodeJS 的新手,有 express 和 Sequelize。当我想创建图书租赁时,控制台会提示我“图书与租赁无关”。 当我将表迁移到 sql 数据库时,id 就在它们的位置并且我的播种机正
我有众所周知的错误: implicit declaration of function 'STLINKReadSytemCalls' [-Wimplicit-function-declaration]
我是一名优秀的程序员,十分优秀!