什么样的应用程序可以在多核CPU上表现更好?
我只是想知道是否有一个简单的方法来判断什么样的应用程序可以在多核CPU上表现更好?如Memcached、redis、MySQL、Cassandra等。
I just want to know that if there is a simple way of judging what kind of apps can perform better on multi-core cpu? Such as Memcached, redis, MySQL, Cassandra and so on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
任何可以执行独立计算的东西......
我想到的是金融应用程序和图形渲染应用程序。
Anything where independent calculations can be performed...
Financial Applications and Graphics Rendering Applications come to mind.
暴力破解加密哈希。
Bruteforcing cryptographic hashes.
非常简单的例子。
任何具有可分解计算能力的事物。假设您需要将 0 到 800,000 之间的所有数字相加,并且您有一台 8 核机器。
您可以设置8个循环来将1-100,000的数字相加; 100,001-200,000 等等...在每个核心上运行一个,将结果保存在变量中。即循环1、循环2等。然后,当循环终止以获得答案时,将变量添加在一起。
Very simple example.
Anything that has a computation that can be broken down. Say you need to add all numbers from 0-800,000 and you have an 8 core machine.
You can set up 8 loops to add the numbers 1-100,000; 100,001-200,000, etc... run one on each core, save the results in a variable. i.e. loop1,loop2,etc. Then add the variables together when the loops terminate for your answer.
有各种各样的应用程序都可以受益,但如果您想将其归结为一件重要的事情,那么我不得不说任何利用多线程架构的应用程序。如果开发正确,应用程序线程可以在不同的内核上同时运行。诀窍是确保它们不会因过度锁定而序列化。
There are all kinds of apps that could benefit, but if you want to boil it down to just one important thing then I would have to say any application that takes advantage of a multithreaded architecture. If developed correctly the application threads could be ran simultaneously on different cores. The trick is to make sure they do not serialize from excessive locking.