软件线程与硬件线程 [英] software threads vs hardware threads

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

问题描述

软件线程,硬件线程和Java线程之间有什么区别?

What is the difference between software threads, hardware threads and java threads?

软件线程,Java线程和硬件线程是独立的还是相互依赖的? 我之所以这样问是因为,我知道Java线程是在jvm(java.exe)的进程内创建的.

Are software threads, java threads and hardware threads independent or interdependent? I am asking this because, I know Java threads are created inside a process with in jvm (java.exe).

这些不同的进程是在不同的硬件线程上执行的吗?

Also is it true that these different process are executed on different hardware threads?

推荐答案

软件线程是由操作系统管理的执行线程.

Software threads are threads of execution managed by the operating system.

硬件线程是某些处理器的功能,在某些情况下允许更好地利用处理器.它们可能作为附加核心(超线程")暴露于操作系统中/由操作系统公开.

Hardware threads are a feature of some processors that allow better utilisation of the processor under some circumstances. They may be exposed to/by the operating system as appearing to be additional cores ("hyperthreading").

在Java中,您创建的线程维护软件线程抽象,其中JVM是操作系统". JVM是否将Java线程映射到OS线程是JVM的事情(但几乎可以肯定).然后操作系统将使用可用的硬件线程.

In Java, the threads you create maintain the software thread abstraction, where the JVM is the "operating system". Whether the JVM then maps Java threads to OS threads is the JVM's business (but it almost certainly does). And then the OS will be using hardware threads if they are available.

这篇关于软件线程与硬件线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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