【发布时间】:2015-11-06 02:28:49
【问题描述】:
据我了解,在多对一映射中,一个内核线程管理多个用户线程。这个内核线程帮助用户线程进行系统调用等。我不明白的是:
- 如果单个阻塞调用可以实现多对一映射,为什么我们还要进行多对一映射? 阻塞所有由内核线程管理的用户线程?
- 在用户线程到内核线程的多对一映射中,执行所有 用户线程必须来自同一个进程?
- 在多对一映射中,所有用户线程可以运行在不同的 内核/CPU 一次运行,还是一次只运行其中一个?
【问题讨论】:
-
谷歌搜索有什么问题?例如,fourth reference:
if a blocking system call is made, then the entire process blocks,Because a single kernel thread can operate only on a single CPU, the many-to-one model does not allow individual processes to be split across multiple CPUs。 -
在对问题投反对票之前,我建议您阅读所有子问题,以确保您在谷歌或其他地方的某个地方获得了所有问题的答案。仅供参考,我在 Google 上找不到它们,因此在此处发布。此外,子问题有些相关。
-
其实,reference 我已经提供了包含你所有问题的答案:1.
Thread management is handled by the thread library in user space, which is very efficient.。 2.multi-threaded applications have multiple threads within a single process, each having their own program counter...3.Because a single kernel thread can operate only on a single CPU....是的,不同问题的详细程度不同,但这是因为您同时有多个问题。 -
当您尝试 google 时,您肯定已经看到了一些关于您的问题的信息。如果您还没有理解这些信息,最好在您的问题帖子中qoute 并询问您到底有什么不明白。这样您就可以明确地展示您的努力,因此没有理由拒绝投票。此外,这样您可以获得更详细的答案。
-
在谷歌上搜索答案是没有用的——其他学生都是这样做的。
标签: linux multithreading process linux-kernel operating-system