我在某种程度上了解多线程和任务处理,但知道在操作系统之外,大多数 Windows 应用程序仅限于使用 1/N CPU 的平均最大值。利用率。
这是双核的 50%,4 个 CPU 的 25% 和所有 8 个 CPU 的 12.5%。如果使用 Procexp.exe 取消分配 CPU 或选择偶数或奇数 CPU,这不会更改结果。
有什么方法可以增加超出此操作系统限制的利用率。我理解如果一个应用程序 100% 强加给一个应用程序。操作系统可能会在预期或要求的超时时间内因无响应的硬件 I/O 出现蓝屏,但即使是 50% 或 75% 也会改善我的结果。
然而,在执行大型任务时,操作系统中的 explorer.exe 等有时可以达到 50% 或更多(?)。
我在 LibreOffice SCALC.exe 上使用 Win7 i7-4770S Haswell 3.1GHz 和 16GB RAM 以及一个包含 150 万个 CV19 美国数据单元格的电子表格,并进行了搜索/替换 ' 文本前缀以尝试将文本转换为每天的单元格编号日期(有一些从文本到值的选项)并且它仍在运行(是的)并且很明显我使用了错误的方法。
如果无法更改操作系统利用率,那么我是否应该重写这个问题,将 400 个文本条目转换为日期 '1\20\2020 的值,以重新格式化为我喜欢的值。
SCALC还在运行!” ,根据使用 11 个线程的 PERFMON,为 12.5%。
问题始于在 150 万个单元格电子表格中搜索和替换 1 个字符。我选择了“similarity-option”,这是一个错误,但问题不是 Excel 或 Open Office Apps,许多应用程序是多线程的,但平均限制为 1/N 个 CPU,无法更改。我可以用图像证明这一点,但你们中的一些人会知道这是真的。
其他人不明白这个问题。是的,可以编写或为 Windows 执行此操作,但不能使用罐装应用程序。
示例 1 一个大文件进程的简单启动恢复只需要几秒钟,并且达到 20% 以上的峰值。它可以在一秒钟内达到超过平均 12.5% 的峰值,但在内存吞吐量限制时我认为不会持续。(所以我想没有什么可以改善这一点?)
在这里搜索在 150 万个单元格上用 0 替换 0 在我捕获屏幕截图之前平均正好是 12.5%。
这里几乎完全是 1/N 或所有 CPU 工作负载的 12.5% 专用于具有多个线程的 1 个应用程序。
我可以使用这种架构在 Windows 下的许多其他应用程序上复制这个测试。那么它是架构 - 内存缓存总线有限和任何修复?
正如其他人在此论坛上所写,1/N CPU 的限制或 12.50 %
这就是证据。
More proof on multi-thread MS App i=only using 1/N CPU % average MAX
Installed WordPerfect 2020 with QUattro Pro and ran the exact same multi-threaded process and got exactly THE SAME RESULT MAX CPU USE on all 8 CPUs = 1/8 = 12.5%
I doubt it was Mark's ability to program multi-threading here. :) (MS Fellow)
Not all tasks are inherently capable of being split into a task that is able to simultaneously run on every core of the CPU.
Each core in your CPU is a fully fledged processor. It is able to maintain information on the execution state of one hardware "thread". Each core has its own cache and data handling independent of every other core. They might share a cache and memory bus, but they are otherwise completely separate.
That thread translates roughly to what is known in software as a thread.
The problem you are seeing is that the particular task doing the work within that software is inherently single threaded.
A single thread is only capable of executing on one core at a time. On an 8 core processor that means that a single thread can use at most 1/8th of your processor, or 12.5% according to task manager. On a 4 core processor that is 1/4 or 25%.
A program can have many threads, but those threads can only work on things that are completely unrelated to each other. One thread might be handling updating data being the scenes, another might be updating the GUI and so on.
What threads cannot do is work on the exact same data at the same time without communicating with each other and it is that limit you are seeing.
In order to use more than one CPU core the task being done has to be split up and parcelled out to multiple threads. That splitting up is a programming problem and is down to the software engineers to implement. Whether or not any given task is multithreaded is down to the complexity of that task and whether it can be split up in the first place
如果数据完全依赖于以特定方式处理,那么它永远不会使用多个核心。
如果数据可以拆分但需要更多的工作来拆分和重新合并,那么软件工程师可能会认为不值得付出努力,而是坚持使用一个线程/核心。
如果数据可以拆分并且软件设计为这样做,那么您将看到超过 1 个正在使用的内核。
我知道 Excel 支持多核计算的许多任务,但它完全依赖于彼此绝对没有依赖关系的数据。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句