Hi,
I'm running a multithreaded program in OpenMP on linux to study CPU
overloading. As the subject says, I need to know the number of threads this
program creates (assuming in this case, number of threads in this program
is same as the number of user threads) from the information kernel provides.
I'm looking something similar to run-queue length from "sar -q 0" that
gives me exact picture of number of user threads. From the implementation
of sar, I found that this information is fetched from /proc filesystem.
So is there anyway that /proc fs gives me the number of threads running in
the system, apart from /proc/cpuinfo that gives me a static information of
existing CPUs.
--
Thanks,
Kris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120226/31ce3c45/attachment.html
Hi Kris,
On Sun, Feb 26, 2012 at 3:15 AM, emani murali [off-list ref] wrote:
Hi,
?I'm running a multithreaded program in OpenMP on linux to study CPU
overloading.?As the subject says, I need to know the number of threads this
program creates (assuming in this case, number of threads in this program is
same as the number of user threads) from the information kernel provides.
I'm looking something similar to run-queue length from "sar -q 0" that gives
me exact picture of number of user threads. From the implementation of sar,
I found that this information is fetched from /proc filesystem.
So is there anyway that /proc fs gives me the number of threads running in
the system, apart from /proc/cpuinfo that gives me a static information of
existing CPUs.
There is a directory in /proc/PID/task for each thread contained
within a process.
--
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
Hi,
You will get Number of Threads info your process is created is in
/proc/pid/status
root at kernel:/proc# ls /proc/1951/task/
1951 1957 2162
root at kernel:/proc#
root at kernel:/proc# cat /proc/1951/status | grep -i Threads:
Threads: 3
root at kernel:/proc#
root at kernel:/proc# cat /proc/self/status | grep -i Threads:
Threads: 1
root at kernel:/proc#
Thanks & Regards,
PraviN
On Sun, Feb 26, 2012 at 11:11 PM, Dave Hylands [off-list ref] wrote:
Hi Kris,
On Sun, Feb 26, 2012 at 3:15 AM, emani murali [off-list ref] wrote:
quoted
Hi,
I'm running a multithreaded program in OpenMP on linux to study CPU
overloading. As the subject says, I need to know the number of threads
this
quoted
program creates (assuming in this case, number of threads in this
program is
quoted
same as the number of user threads) from the information kernel provides.
I'm looking something similar to run-queue length from "sar -q 0" that
gives
quoted
me exact picture of number of user threads. From the implementation of
sar,
quoted
I found that this information is fetched from /proc filesystem.
So is there anyway that /proc fs gives me the number of threads running
in
quoted
the system, apart from /proc/cpuinfo that gives me a static information
of
quoted
existing CPUs.
There is a directory in /proc/PID/task for each thread contained
within a process.
--
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
--
Thanks & Regards,*
---------PraviN---------*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120226/9665968c/attachment.html