Hi,<br><br>You will get Number of Threads info your process is created is in /proc/pid/status<br><br>root@kernel:/proc# ls /proc/1951/task/ <br>1951 1957 2162<br>root@kernel:/proc# <br>root@kernel:/proc# cat /proc/1951/status | grep -i Threads:<br>
Threads: 3<br>root@kernel:/proc# <br>root@kernel:/proc# cat /proc/self/status | grep -i Threads:<br>Threads: 1<br>root@kernel:/proc#<br><br><br>Thanks & Regards,<br> PraviN<br><br><br><div class="gmail_quote">
On Sun, Feb 26, 2012 at 11:11 PM, Dave Hylands <span dir="ltr"><<a href="mailto:dhylands@gmail.com">dhylands@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi Kris,<br>
<div><div class="h5"><br>
On Sun, Feb 26, 2012 at 3:15 AM, emani murali <<a href="mailto:murali132@gmail.com">murali132@gmail.com</a>> wrote:<br>
> Hi,<br>
> I'm running a multithreaded program in OpenMP on linux to study CPU<br>
> overloading. As the subject says, I need to know the number of threads this<br>
> program creates (assuming in this case, number of threads in this program is<br>
> same as the number of user threads) from the information kernel provides.<br>
><br>
> I'm looking something similar to run-queue length from "sar -q 0" that gives<br>
> me exact picture of number of user threads. From the implementation of sar,<br>
> I found that this information is fetched from /proc filesystem.<br>
><br>
> So is there anyway that /proc fs gives me the number of threads running in<br>
> the system, apart from /proc/cpuinfo that gives me a static information of<br>
> existing CPUs.<br>
<br>
</div></div>There is a directory in /proc/PID/task for each thread contained<br>
within a process.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Dave Hylands<br>
Shuswap, BC, Canada<br>
<a href="http://www.davehylands.com" target="_blank">http://www.davehylands.com</a><br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Thanks & Regards,<b><br>---------PraviN---------</b><br><br><br>