多线程有一点意义吗? [英] Is there a point to multithreading?

查看:112
本文介绍了多线程有一点意义吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想让这个主观...

I don’t want to make this subjective...

如果不需要考虑I/O和其他与输入/输出相关的瓶颈,那么我们是否需要编写多线程代码?从理论上讲,单线程代码的性能会更好,因为它将获得所有CPU周期.正确的?

If I/O and other input/output-related bottlenecks are not of concern, then do we need to write multithreaded code? Theoretically the single threaded code will fare better since it will get all the CPU cycles. Right?

如果JavaScript或ActionScript是多线程的,它们的性能会更好吗?

Would JavaScript or ActionScript have fared any better, had they been multithreaded?

我只是想了解多线程的真正需求.

I am just trying to understand the real need for multithreading.

推荐答案

我不知道您最近(过去5年)是否关注硬件趋势,但我们正朝着多核世界发展.

I don't know if you have payed any attention to trends in hardware lately (last 5 years) but we are heading to a multicore world.

一般的唤醒电话是免费午餐已经结束" 文章.

A general wake-up call was this "The free lunch is over" article.

在双核PC上,单线程应用程序将仅获得一半的CPU周期.而且CPU不再变得越来越快,摩尔定律的这一部分已经失效.

On a dual core PC, a single-threaded app will only get half the CPU cycles. And CPUs are not getting faster anymore, that part of Moores law has died.

这篇关于多线程有一点意义吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆