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 &amp; Regards,<br>    PraviN<br><br><br><div class="gmail_quote">
On Sun, Feb 26, 2012 at 11:11 PM, Dave Hylands <span dir="ltr">&lt;<a href="mailto:dhylands@gmail.com">dhylands@gmail.com</a>&gt;</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 &lt;<a href="mailto:murali132@gmail.com">murali132@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;  I&#39;m running a multithreaded program in OpenMP on linux to study CPU<br>
&gt; overloading. As the subject says, I need to know the number of threads this<br>
&gt; program creates (assuming in this case, number of threads in this program is<br>
&gt; same as the number of user threads) from the information kernel provides.<br>
&gt;<br>
&gt; I&#39;m looking something similar to run-queue length from &quot;sar -q 0&quot; that gives<br>
&gt; me exact picture of number of user threads. From the implementation of sar,<br>
&gt; I found that this information is fetched from /proc filesystem.<br>
&gt;<br>
&gt; So is there anyway that /proc fs gives me the number of threads running in<br>
&gt; the system, apart from /proc/cpuinfo that gives me a static information of<br>
&gt; 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 &amp; Regards,<b><br>---------PraviN---------</b><br><br><br>