<?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: Question on pthread_exit in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094787#M92360</link>
    <description>&lt;P&gt;&amp;gt;I'm not using an explicit call to pthread_exit, so I think I can't able to put a breakpoint.&lt;BR /&gt;&lt;BR /&gt;No, you can still set a breakpoint there to see who else calls it. In my case I'm just returning out of the start routine:&lt;BR /&gt;(gdb) bt&lt;BR /&gt;#0 0x2000000076ef1a30:2 pthread_exit+0x72 /usr/lib/hpux32/libpthread.so.1&lt;BR /&gt;#1 0x2000000076ef04c0:0 __pthread_bound_body+0x190 libpthread.so.1&lt;BR /&gt;&lt;BR /&gt;So libpthread automatically calls it.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;If there is no explicit call to pthread_exit, will it lead to memory leak.&lt;BR /&gt;&lt;BR /&gt;No, you may leak memory if you don't return/throw back to your start routine.&lt;BR /&gt;Especially if you have locals that are STL containers. See:&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/10946/threads.htm" target="_blank"&gt;http://docs.hp.com/en/10946/threads.htm&lt;/A&gt;&lt;BR /&gt;Pthreads (Posix Threads) Limitations&lt;/P&gt;</description>
    <pubDate>Sun, 18 Sep 2011 21:55:33 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-09-18T21:55:33Z</dc:date>
    <item>
      <title>Doubt with pthread_exit</title>
      <link>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094784#M92357</link>
      <description>Manual page of pthread_create says it will implicitly call pthread_exit when start_routine returns.&lt;BR /&gt;Is there way to know whether pthread_exit is called.&lt;BR /&gt;In c++ we can have a print statement in destructor function, which shows that destructor is called when an object is getting out.</description>
      <pubDate>Wed, 31 Oct 2007 01:24:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094784#M92357</guid>
      <dc:creator>rymani</dc:creator>
      <dc:date>2007-10-31T01:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Question on pthread_exit</title>
      <link>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094785#M92358</link>
      <description>&lt;P&gt;&amp;gt;In C++ we can have a print statement in destructor function, which shows that destructor is called when an object is getting out.&lt;BR /&gt;&lt;BR /&gt;There is no connection between destructors and threads.&lt;BR /&gt;If you call pthread_exit, the destructors for any local objects will not be called. (At least on IPF.)&lt;BR /&gt;&lt;BR /&gt;Since you are returning from the start function that already calls the destructors for any locals.&lt;BR /&gt;&lt;BR /&gt;If you want to know if pthread_exit is called, put a breakpoint there.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2011 21:54:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094785#M92358</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-18T21:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt with pthread_exit</title>
      <link>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094786#M92359</link>
      <description>&amp;gt;If you want to know if pthread_exit is called, put a breakpoint there.&lt;BR /&gt;&lt;BR /&gt;I'm not using an explicit call to pthread_exit, so i think i can't able to put a breakpoint.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;If you call pthread_exit, the destructors for any local objects will not be called.&lt;BR /&gt;&lt;BR /&gt;If there is no explicit call to pthread_exit, will it lead to memory leak.</description>
      <pubDate>Fri, 02 Nov 2007 04:21:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094786#M92359</guid>
      <dc:creator>rymani</dc:creator>
      <dc:date>2007-11-02T04:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Question on pthread_exit</title>
      <link>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094787#M92360</link>
      <description>&lt;P&gt;&amp;gt;I'm not using an explicit call to pthread_exit, so I think I can't able to put a breakpoint.&lt;BR /&gt;&lt;BR /&gt;No, you can still set a breakpoint there to see who else calls it. In my case I'm just returning out of the start routine:&lt;BR /&gt;(gdb) bt&lt;BR /&gt;#0 0x2000000076ef1a30:2 pthread_exit+0x72 /usr/lib/hpux32/libpthread.so.1&lt;BR /&gt;#1 0x2000000076ef04c0:0 __pthread_bound_body+0x190 libpthread.so.1&lt;BR /&gt;&lt;BR /&gt;So libpthread automatically calls it.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;If there is no explicit call to pthread_exit, will it lead to memory leak.&lt;BR /&gt;&lt;BR /&gt;No, you may leak memory if you don't return/throw back to your start routine.&lt;BR /&gt;Especially if you have locals that are STL containers. See:&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/10946/threads.htm" target="_blank"&gt;http://docs.hp.com/en/10946/threads.htm&lt;/A&gt;&lt;BR /&gt;Pthreads (Posix Threads) Limitations&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2011 21:55:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094787#M92360</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-18T21:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt with pthread_exit</title>
      <link>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094788#M92361</link>
      <description>Thanks Dennis, for the valuable suggestions provided.</description>
      <pubDate>Sat, 03 Nov 2007 05:19:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/doubt-with-pthread-exit/m-p/4094788#M92361</guid>
      <dc:creator>rymani</dc:creator>
      <dc:date>2007-11-03T05:19:33Z</dc:date>
    </item>
  </channel>
</rss>

