除了使用亲和力掩码之外,如何在 Linux 中找到线程亲和力?

发布于 2024-12-01 19:20:40 字数 213 浏览 5 评论 0原文

我们有一个运行 SMP Linux (2.6.18) 的嵌入式 MIPS 2 核处理器。

我们计划将主 GUI 线程的亲和力分配给两个核心之一,另一个核心用于驱动程序/数据路径处理。

然而,有人提出的问题是如何判断哪些线程位于哪个核心上?

我可以很好地获得亲和力掩码,但是有没有其他方法可以告诉(例如/proc系统)哪些线程位于哪个核心上?

谢谢。

We have an embedded MIPS 2-core processor running SMP Linux (2.6.18).

We are planning to assign the affinity of the main GUI threads to one of the two cores, and the other core used for driver/data path processing.

However, the questions has been asked of how do you tell which threads are on which core?

I can get the affinity mask fine, but is there any other way of telling (e.g. /proc system) which threads are on which core?

Thanks.

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

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

发布评论

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

评论(1

面犯桃花 2024-12-08 19:20:40

sched_getcpu - 确定调用线程正在其上运行的CPU

<前><代码> man sched_getcpu()

sched_getcpu - determine CPU on which the calling thread is running

   man sched_getcpu()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文