简体   繁体   English

在Linux内核(模块编程)中如何从多线程进程获取线程?

[英]In the Linux kernel (module programming) how to get threadids from a multithreaded process?

current->pid gets the process id accessing the module...but I want the threadid from the process in a multithreaded program accessing my module. current-> pid获取访问模块的进程ID ...但我希望来自多线程程序中的进程的threadid访问我的模块。 What is the call to do this? 这样做的呼吁是什么? I can't find it anywhere! 我找不到任何地方!

The linux kernel does not see multithreaded processes in the same way as the POSIX thread library (which I assume is what you mean by thread id). Linux内核没有像POSIX线程库那样看到多线程进程(我假设你的意思是线程ID)。 The kernel has tasks which are somewhat separate processes looped together by the thread library. 内核的任务是由线程库循环在一起的某些独立的进程。 This paper from IBM gives a more detailed explanation. IBM的这篇论文给出了更详细的解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM