在linux上将多核合并为单核处理,可能吗?
我正在考虑一个想法,其中一个遗留应用程序需要在 Core i7 cpu 上以全部性能运行。是否有任何 Linux 软件/实用程序可以组合该应用程序的所有核心,以便它可以比仅使用 1 个核心以更高的性能进行处理?
该应用程序是 readpst,它仅使用 1 个核心来处理 Outlook PST 文件。
如果不能使用所有核心也没关系,如果可以使用 3 个核心就可以了。
可能的?还是我喝醉了?
如果我对多分叉的 C 知识很好,我将重写它以使用多个核心。
I am thinking about an idea , where a lagacy application needing To run on full performance on Core i7 cpu. Is there any linux software / utility to combine all cores for that application, so it can process at some higher performance than using only 1 core?
the application is readpst and it only uses 1 Core for Processing outlook PST files.
Its ok if i can't use all cores , it will be fine if can use like 3 cores.
Possible? or am i drunk?
I will rewrite it to use multiple cores if my C knowledge on multi forking is good.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
基于 Intel Nehalem 的 CPU(i7、i5、i3)已经在一定程度上做到了这一点。
通过使用睿频加速模式,当使用单个核心时,它会自动超频,直到达到功率和温度限制。
较新版本的 i7(2K 芯片)在这方面做得更好。
阅读此内容,以及这个。
Intel Nehalem-based CPUs (i7, i5, i3) already do this to an extent.
By using their Turbo Boost mode, when a single core is being used it is automatically over-clocked until the power and temperature limits are reached.
The newer versions of the i7 (the 2K chips) do this even better.
Read this, and this.
“有可能吗?还是我喝醉了?”
你喝醉了!如果这在一般情况下很容易,英特尔现在就会将其内置到处理器中!
"Possible? or am i drunk?"
You're drunk! If this was easy in the general case, Intel would have built it into the processors by now!
您正在寻找的称为“单一系统映像”或 SSI。互联网上关于人们做这样的事情的信息很少,因为它往往是为超级计算(也许还有服务器)保留的。
http://en.wikipedia.org/wiki/Single_system_image
What you're looking for is called 'Single System Image' or SSI. There is scant information on the internet about people doing such a thing, as it tends to be reserved for super computing (and perhaps servers).
http://en.wikipedia.org/wiki/Single_system_image
不可以,应用程序需要多线程才能使用多个内核。当然,如果您愿意,您可以自由地编写该应用程序的多线程版本,但确保不同的线程不会相互干扰可能并不容易。
No, the application needs to be multi-threaded to use more than one core. You're of course free to write a multi-threaded version of that application if you wish, but it may not be easy to make sure the different threads don't mess each other up.
如果您希望它减轻多核的负担,那么您可以编写程序的多线程版本。但前提是它实际上是可并行的。您说您正在读取 pst 文件,请注意不要遇到 IO 瓶颈。
POSIX Threads 是一个用于处理线程、互斥量、信号量等的优秀库。
If you want it to alleviate multiple cores then you could write a multi-threaded version of your program. But only in the case that it is actually parallelizable. You said you were reading from pst-files, take care not to run into IO bottlenecks.
A great library for working with threads, mutex, semaphores and so on is POSIX Threads.
目前还没有这样的应用程序,但这是可能的。
当操作系统在虚拟机中运行时,虚拟机管理程序可以利用几个CPU来识别哪些CPU代码可以并行运行,而不需要顺序运行,然后它们实际上可以同时使用其他几个CPU来完成,
在下一秒,当操作CPU空闲时(因为它们完成工作的速度更快,然后管理器可以为它们提供新的指令,它们可以开始计算下一秒的指令。
我们需要在Hypervisor级别上执行此操作的原因,以及不在操作系统内,是因为内存锁定,这是不可能的。
There is'nt available such an application, but it is possible.
When a OS will run in a VM, then the hypervisor could make use of a few CPUs to identify which CPU code could run parallel, and are not required to run sequentially, and then they could be actually done with a few other CPUs at once,
In the next second when the Operating CPUs are idle (because they finished their work faster then the menager can provide them with new they can start calculating the next second of instructions.
The reason why we need to do this on the Hypervisor level, and not within the OS, is because of memory locking this wouldnt be possible.