Re: Threads information /proc

[email protected] (Christos Zoulas)
Newsgroups gmane.os.netbsd.help
Message-ID <[email protected]>
In article <[email protected]>,
aalu paneer <[email protected]> wrote:
>Hello All,
>
>I am trying to port an application from Linux to NetBSD.
>
>The application needs to know how many threads any given process has.
>In Linux, it looks into /proc/<pid>/task for a count and thread id of
>the various threads.

This depends on the thread model used. If I am running under the old
linux threads (non NPTL), each thread is a process, and both stat
and tasks report the wrong information.

>But /proc in NetBSD does not carry this information. Even the number
>of threads reported in /proc/<pid>/stat is not proper.

Same...

>Any suggestion on how to get the information provided in Linux via
>/proc/<pid>/task in NetBSD?

Our linux emulation needs a lot of tender love and attention so that
it will be able to emulate applications that assume and require NPTL.
We could in the short term fix procfs to create the task subdirectory
and populate it with the information from curproc, but I don't think
that this will be enough.

christos
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.