in reply to Proc::ProcessTable

Shalom yuvalle1!

I believe that the threads implementation in newer Linux kernels is different than in RH 7.3. In particular, separate threads will no longer show up as separate processes (as in, having a separate PID).

I don't know of another way to count the threads of a process, but if I come across one, I'll let you know...

Update: What kernel is it? (what does uname -r say?) If it's 2.6, you may be able to use the /proc/$$/task directory. (Thanks to theorbtwo and ambrus for CB info).

--
edan

Replies are listed 'Best First'.
Re^2: Proc::ProcessTable
by yuvalle1 (Initiate) on Jul 06, 2004 at 12:30 UTC
    Hi edan! Thanks for your reply. The thread implementation had changed, but not that dramatically - each thread has its pid and has a directory in /proc, so I was hoping that this module will still function (in vain). It seems that there is a group_id for each thread that equals the pid of the thread that created it. It is interesting that ps for example can give all the threads when it is used with the -m flag. I guess it is not that hard to count it myself using the /proc data, but I don't feel like it :) The kernel version we are using here is 2.4.21-4.ELsmp Thanks again for your help! yuvalle1