<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: No of threads per process in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/no-of-threads-per-process/m-p/4070794#M94773</link>
    <description>One of two things come to mind.&lt;BR /&gt;&lt;BR /&gt;Either you are:&lt;BR /&gt;&lt;BR /&gt;a) Compiling on 11.31 and attempting to run the binary on 11.23.&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;b) Not using -D_PSTAT64 in compilation.&lt;BR /&gt;&lt;BR /&gt;I lean towards (a) since it looks like the 11.23 kernel is complaining about the size of the data structure in the pstat_getproc() call [and since pstat structures usually get new fields between releases (at the end for compatibility) that fits... the 11.31 structure is larger than the 11.23 kernel expects].&lt;BR /&gt;&lt;BR /&gt;Compile the program on 11.23, and use the -D_PSTAT64 (since it doesn't work right otherwise from what I can tell) if you compile DD32.. or just compile DD64.&lt;BR /&gt;&lt;BR /&gt;Here's my result on a r11.23 box:&lt;BR /&gt;# uname -a&lt;BR /&gt;HP-UX unknown B.11.23 U ia64 2456779667 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;# cc +DD32 -D_PSTAT64 -o tpp tpp.c&lt;BR /&gt;&lt;BR /&gt;# ./tpp |more&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------------------------------------------------------&lt;BR /&gt;   PID |   UID |Threads|   RSS | Command&lt;BR /&gt;------------------------------------------------------------------------------&lt;BR /&gt;     0 |     0 |     1 |    16 | swapper &lt;BR /&gt;     1 |     0 |     2 |   153 | init &lt;BR /&gt;     8 |     0 |     2 |    32 | kmemdaemon &lt;BR /&gt;     9 |     0 |     2 |    80 | ioconfigd &lt;BR /&gt;    10 |     0 |    12 |   192 | ObjectThreadPool &lt;BR /&gt;&lt;BR /&gt;&lt;REST snipped=""&gt;&lt;/REST&gt;</description>
    <pubDate>Fri, 14 Sep 2007 12:47:18 GMT</pubDate>
    <dc:creator>Don Morris_1</dc:creator>
    <dc:date>2007-09-14T12:47:18Z</dc:date>
    <item>
      <title>No of threads per process</title>
      <link>https://community.hpe.com/t5/operating-system-linux/no-of-threads-per-process/m-p/4070793#M94772</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;While trying to figure out no of threads per process on HP-UX(In case of linux, i think the Threads field of /proc/&lt;PID&gt;/status will do),i found this (attached here)small utility(written in C) which finds the no of threads per process.&lt;BR /&gt;&lt;BR /&gt;This is working fine on a HP-UX 11.31 machine(IA) but not on hp-ux 11.23 machine(IA).&lt;BR /&gt;&lt;BR /&gt;Snip for both the OS(11.31 and 11.23):&lt;BR /&gt;--------------------------------------&lt;BR /&gt;On 11.31 IA machine:&lt;BR /&gt;&lt;BR /&gt;[root@hpia5][/]uname -a&lt;BR /&gt;HP-UX hpia5 B.11.31 U ia64 1278630092 unlimited-user license&lt;BR /&gt;[root@hpia5][/]model&lt;BR /&gt;ia64 hp server rx2620&lt;BR /&gt;[root@hpia5][/]cc -o threads_per_process threads_list.c&lt;BR /&gt;[root@hpia5][/]./threads_per_process |head&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------------------------------------------------------&lt;BR /&gt;   PID |   UID |Threads|   RSS | Command&lt;BR /&gt;------------------------------------------------------------------------------&lt;BR /&gt;     0 |     0 |     1 |    16 | swapper&lt;BR /&gt;     1 |     0 |     2 |   164 | init&lt;BR /&gt;    11 |     0 |    12 |   192 | ObjectThreadPool&lt;BR /&gt;    10 |     0 |     1 |    16 | ttisr&lt;BR /&gt;     9 |     0 |     3 |    48 | ksyncer_daemon&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;On 11.23 IA machine:&lt;BR /&gt;root@hpia7/ &amp;gt;uname -a&lt;BR /&gt;HP-UX hpia7 B.11.23 U ia64 0785257145 unlimited-user license&lt;BR /&gt;root@hpia7/ &amp;gt;model&lt;BR /&gt;ia64 hp server rx2620&lt;BR /&gt;root@hpia7/ &amp;gt;./threads_per_process |head&lt;BR /&gt;pstat_getproc failed: Value too large to be stored in data type&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------------------------------------------------------&lt;BR /&gt;   PID |   UID |Threads|   RSS | Command&lt;BR /&gt;------------------------------------------------------------------------------&lt;BR /&gt;     0 |     0 |     1 |    16 | swapper&lt;BR /&gt;     0 |     0 |     0 |     0 |&lt;BR /&gt;     0 |     0 |     0 |     0 |&lt;BR /&gt;     0 |     0 |     0 |     0 |&lt;BR /&gt;     0 |     0 |     0 |     0 |&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;more info here: &lt;A href="http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=060818f70fe0211018f70fe02110275d6e10RCRD" target="_blank"&gt;http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=060818f70fe0211018f70fe02110275d6e10RCRD&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I am not much of programmer,but would definitely like to port this program to work&lt;BR /&gt;on HP-UX 11.23 as well,Or if there is another&lt;BR /&gt;full proof method to determine this(No of threads per process)then please let me know.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;~amit&lt;BR /&gt;&lt;/PID&gt;</description>
      <pubDate>Fri, 14 Sep 2007 11:14:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/no-of-threads-per-process/m-p/4070793#M94772</guid>
      <dc:creator>amit mehta_2</dc:creator>
      <dc:date>2007-09-14T11:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: No of threads per process</title>
      <link>https://community.hpe.com/t5/operating-system-linux/no-of-threads-per-process/m-p/4070794#M94773</link>
      <description>One of two things come to mind.&lt;BR /&gt;&lt;BR /&gt;Either you are:&lt;BR /&gt;&lt;BR /&gt;a) Compiling on 11.31 and attempting to run the binary on 11.23.&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;b) Not using -D_PSTAT64 in compilation.&lt;BR /&gt;&lt;BR /&gt;I lean towards (a) since it looks like the 11.23 kernel is complaining about the size of the data structure in the pstat_getproc() call [and since pstat structures usually get new fields between releases (at the end for compatibility) that fits... the 11.31 structure is larger than the 11.23 kernel expects].&lt;BR /&gt;&lt;BR /&gt;Compile the program on 11.23, and use the -D_PSTAT64 (since it doesn't work right otherwise from what I can tell) if you compile DD32.. or just compile DD64.&lt;BR /&gt;&lt;BR /&gt;Here's my result on a r11.23 box:&lt;BR /&gt;# uname -a&lt;BR /&gt;HP-UX unknown B.11.23 U ia64 2456779667 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;# cc +DD32 -D_PSTAT64 -o tpp tpp.c&lt;BR /&gt;&lt;BR /&gt;# ./tpp |more&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------------------------------------------------------&lt;BR /&gt;   PID |   UID |Threads|   RSS | Command&lt;BR /&gt;------------------------------------------------------------------------------&lt;BR /&gt;     0 |     0 |     1 |    16 | swapper &lt;BR /&gt;     1 |     0 |     2 |   153 | init &lt;BR /&gt;     8 |     0 |     2 |    32 | kmemdaemon &lt;BR /&gt;     9 |     0 |     2 |    80 | ioconfigd &lt;BR /&gt;    10 |     0 |    12 |   192 | ObjectThreadPool &lt;BR /&gt;&lt;BR /&gt;&lt;REST snipped=""&gt;&lt;/REST&gt;</description>
      <pubDate>Fri, 14 Sep 2007 12:47:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/no-of-threads-per-process/m-p/4070794#M94773</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2007-09-14T12:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: No of threads per process</title>
      <link>https://community.hpe.com/t5/operating-system-linux/no-of-threads-per-process/m-p/4070795#M94774</link>
      <description>Hi Morris,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.After compiling with&lt;BR /&gt;cc +DD32 -D_PSTAT64 option,it is working now.&lt;BR /&gt;&lt;BR /&gt;Excerpt from the man page of cc :&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;On my system there wasn't MAN pages for cc,but those available here(link below) has&lt;BR /&gt;no info on "D_PSTAT64". &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?debug=0&amp;amp;manpage=/opt/ansic/share/man/man1.Z/cc.1)" target="_blank"&gt;http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?debug=0&amp;amp;manpage=/opt/ansic/share/man/man1.Z/cc.1)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also can you share some insight on hp-ux internals, poritng, hp-ux development to novice like me who aspire to involve in hp-ux development.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot again,Points to follow :)&lt;BR /&gt;&lt;BR /&gt;~amit&lt;BR /&gt;</description>
      <pubDate>Sat, 15 Sep 2007 04:38:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/no-of-threads-per-process/m-p/4070795#M94774</guid>
      <dc:creator>amit mehta_2</dc:creator>
      <dc:date>2007-09-15T04:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Number of threads per process (pstat)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/no-of-threads-per-process/m-p/4070796#M94775</link>
      <description>&lt;P&gt;&amp;gt;On my system there wasn't MAN pages for cc&lt;BR /&gt;&lt;BR /&gt;If you have purchased the C/aC++ developer's bundle you should have the man page. If you have the bundled C compiler, you are out of luck. You can look at the aC++ Online Help here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/HTML/index.htm" target="_blank"&gt;http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/HTML/index.htm&lt;/A&gt;&lt;BR /&gt;For more info on the aC++ compiler see:&lt;BR /&gt;&lt;A href="http://www.hp.com/go/cpp" target="_blank"&gt;http://www.hp.com/go/cpp&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Why would you expect this with cc(1), see pstat(2):&lt;/P&gt;&lt;P&gt;&lt;A href="http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c03231920/c03231920.pdf" target="_blank"&gt;c03231920.pdf 11.31 Man pages&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://h20566.www2.hp.com/portal/site/hpsc/template.BINARYPORTLET/public/kb/docDisplay/resource.process/?spf_p.tpst=kbDocDisplay_ws_BI&amp;amp;spf_p.rid_kbDocDisplay=docDisplayResURL&amp;amp;javax.portlet.begCacheTok=com.vignette.cachetoken&amp;amp;spf_p.rst_kbDocDisplay=wsrp-resourceState%3DdocId%253Demr_na-c02267025-2%257CdocLocale%253D&amp;amp;javax.portlet.endCacheTok=com.vignette.cachetoken" target="_blank"&gt;http://h20566.www2.hp.com/portal/site/hpsc/template.BINARYPORTLET/public/kb/docDisplay/resource.process/?spf_p.tpst=kbDocDisplay_ws_BI&amp;amp;spf_p.rid_kbDocDisplay=docDisplayResURL&amp;amp;javax.portlet.begCacheTok=com.vignette.cachetoken&amp;amp;spf_p.rst_kbDocDisplay=wsrp-resourceState%3DdocId%253Demr_na-c02267025-2%257CdocLocale%253D&amp;amp;javax.portlet.endCacheTok=com.vignette.cachetoken&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and "Programming Model Considerations" for -D_PSTAT64.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 18:46:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/no-of-threads-per-process/m-p/4070796#M94775</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2014-11-06T18:46:52Z</dc:date>
    </item>
  </channel>
</rss>

