“用户线程不能利用多线程或多处理"是什么意思? [英] What does it mean by "user threads cannot take advantage of multithreading or multiprocessing"?

查看:121
本文介绍了“用户线程不能利用多线程或多处理"是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户线程无法利用多线程或多处理
来源:维基百科

user threads cannot take advantage of multithreading or multiprocessing
source : wikipedia

这是否意味着CPU无法同时有效地执行多个用户线程? 这是否意味着CPU无法在两个或更多用户线程之间切换?

Does this mean a CPU cannot efficiently execute multiple user threads simultaneously ? Does this mean a CPU cannot switch between two or more user threads ?

例如:有两个用户线程t0和t1. t0是第一个要执行的. t1将仅在t0完成后才开始执行,还是可以进行切换?

For example : there are two user threads t0 and t1. t0 is the first one to execute. Will t1 only begin execution when t0 has finished or can switching take place ?

PS:这个问题可能看起来不止一个问题,但我想这只是一个问题.

PS : This question might look like more than one question but I guess it is just one.

推荐答案

页面当前内容如下:

线程有时在用户空间库中实现,因此称为用户线程.内核不知道它们,因此在用户空间中对其进行管理和调度.一些实现将其用户线程基于几个内核线程,以从多处理器机器(M:N模型)中受益.在本文中,术语线程"(没有内核或用户限定符)默认指代内核线程.虚拟机实现的用户线程也称为绿色线程.用户线程通常可以快速创建和管理,但即使所有用户线程已准备好运行,也无法充分利用多线程或多处理功能并阻塞所有与之相关的内核线程.

Threads are sometimes implemented in userspace libraries, thus called user threads. The kernel is unaware of them, so they are managed and scheduled in userspace. Some implementations base their user threads on top of several kernel threads, to benefit from multi-processor machines (M:N model). In this article the term "thread" (without kernel or user qualifier) defaults to referring to kernel threads. User threads as implemented by virtual machines are also called green threads. User threads are generally fast to create and manage, but cannot take advantage of multithreading or multiprocessing and get blocked if all of their associated kernel threads get blocked even if there are some user threads that are ready to run.

正如您所看到的,在一个段落中,这两者都说明用户线程都可以(通过关联的内核线程)利用多处理器,而不能.

As you can see, in one paragraph it is stating BOTH that user threads both can take advantage of multiprocessors (via associated kernel threads), AND that it cannot.

我建议您在Wikipedia页面的对话"页面上问您的问题,看看他们的作者是否可以启发您了解他们的意思……以及他们为什么这么说.

I suggest that you ask your question on the Wikipedia page's Talk page, and see if they authors can enlighten you as to what they mean ... and why they are saying it.

但是我认为他们说的是,没有多个内核线程支持的用户(-空间)线程 通常不能在多个内核上同时执行.

But what I think they are saying that user(-space) threads that aren't backed by multiple kernel threads typically cannot execute simultaneously on multiple cores.

但是,我会毫不犹豫地说,这是用户线程本身所固有的.也就是说,在没有任何内核帮助的情况下,不可能实现一个操作系统,其中应用程序可以利用多个内核.

However, I would hesitate to say that this is inherent to user threads per se; i.e. that it would be impossible to implement an OS in which a application could exploit multiple cores without any kernel assistance.

这篇关于“用户线程不能利用多线程或多处理"是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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