高负载系统和多线程
谁能告诉我,在高负载系统中使用多线程的最佳架构模式或方式是什么? 我读过有关多路复用方法的内容,还有其他方法吗? 谢谢。
Can anyone tell me , What is architectural pattern or way the best for using multi threading in High Load System?
I have read about Multiplexing approach, Is there something else?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不太清楚您所说的“高负载系统”是什么意思,但我假设您指的是商业服务器环境。如今高端服务器芯片的趋势是拥有许多复制核心,每个核心都允许一定程度的多线程。很难说哪种多线程技术是最好的,因为每种技术都提供了可能更适合特定应用程序工作负载的优点。
以Sun UltraSPARC T1为例。它有 8 个核心,每个核心在单个共享管道上最多可支持 4 个线程。核心能够在线程之间无延迟地切换。这种方法称为细粒度时间多线程:细粒度是因为线程可以在每个周期切换,时间是因为线程跨周期交错。
另一种称为同时多线程 (SMT) 的方法允许来自多个线程的指令同时处于同一管道阶段。该技术要求处理器超标量,即能够在单个周期内向流水线发出多条指令。您在服务器市场上往往不会看到那么多这样的情况,因为超标量处理器往往更大、更耗电,不符合服务器群和数据中心所需的规模经济。
I'm not exactly sure what you mean by High Load System, but I'll assume you mean a commercial server environment. The trend for high-end server chips these days is many replicated cores, each of which allows some degree of multi-threading. It's hard to say which multi-threading technique is best, since each offers advantages that may be more appropriate given a certain application workload.
Take the Sun UltraSPARC T1 for example. It has 8 cores, each of which can support up to 4 threads on a single shared pipeline. A core is able to switch between threads with no delay. This approach is called fine-grained temporal multi-threading: fine-grained because threads can switch every cycle, temporal because threads are interleaved across cycles.
Another approach, called Simultaneous Multithreading (SMT) allows instructions from multiple threads to be in the same pipeline stage at the same time. This technique requires that the processor be superscalar, that is, be able to issue multiple instructions to the pipeline in a single cycle. You will tend to not see as much of this in the server market because superscalar processors tend to be bigger and more power-hungry, not in line with the economies of scale that server farms and data centers require.