多线程和 SMP Linux

发布于 2024-09-17 05:33:04 字数 317 浏览 3 评论 0原文

Linux 内核据说是 SMP。 据说进程和内核线程应分布在处理器之间。

  1. 所有 Linux 发行版(如 fedora13、ubuntu 10.04 Lucid)默认都启用 SMP Linux 吗?

  2. 在 SMP Linux 上,最好遵循以下做法: a) 多进程方法 相对 b) 多线程方法

  3. pthread 默认情况下是否创建内核级线程,以便任何应用程序都可以利用 LWP 和 SMP?

如果没有,如何使用 Pthreads 创建内核级线程。 任何参考将不胜感激。

The Linux Kernel is said to be SMP.
It is said that processes and kernel threads shall be distributed across processors.

  1. Does all Linux distribution like fedora13, ubuntu 10.04 Lucid by default enable SMP Linux?

  2. On an SMP Linux, which is better to follow-
    a) multi-process approach
    versus
    b) multi-threading approach

  3. Does pthread by default create a kernel level thread so that any application can take advantage of LWP as well as SMP?

If not, how can one make a kernel level thread using Pthreads.
Any references would be much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尝蛊 2024-09-24 05:33:04
  1. SMP 已经进入内核很多年了。大多数现代系统都至少有两个核心,它几乎总是在使用。
  2. 使用哪个更多地取决于您的问题空间,而不是您拥有的核心数量。
  3. 是的,Pthreads 创建内核级线程。 (如果您想要用户空间线程,您可以使用类似 GNU Pth 的东西)。
  1. SMP has been in the kernel for years now. With most modern systems sporting at least two cores, it is almost always in use.
  2. Which to use depends much more on your problem space than on how many cores you have.
  3. Yes, Pthreads create kernel-level threads. (If you wanted user-space threads, you could use something like GNU Pth).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文