<?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: pthread_create is failing in HP Unix server in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355642#M684105</link>
    <description>Probably want to write the program a little more systematically &lt;BR /&gt;&lt;BR /&gt;/* this is create.c  */&lt;BR /&gt;#include &lt;PTHREAD.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;ERRNO.H&gt;&lt;BR /&gt;&lt;BR /&gt;void  fatal_error(int err_num, char *function);&lt;BR /&gt;void  thread1_func();&lt;BR /&gt;&lt;BR /&gt;/* Print "Hello World!", then "Good-bye World!" */&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt; pthread_t tid;&lt;BR /&gt; int  return_val;&lt;BR /&gt;     printf("start of program \n");&lt;BR /&gt;     sleep(30);&lt;BR /&gt; /* &lt;BR /&gt;  * Create a new thread to execute thread1_func().&lt;BR /&gt;  */&lt;BR /&gt; return_val = pthread_create(&amp;amp;tid, (pthread_attr_t *)NULL,&lt;BR /&gt;        (void *(*)())thread1_func,&lt;BR /&gt;        (void *)NULL);&lt;BR /&gt; if (return_val != 0)&lt;BR /&gt;  fatal_error(return_val, "pthread_create()");&lt;BR /&gt;        printf("doing more work\n");&lt;BR /&gt;        sleep(30);&lt;BR /&gt;&lt;BR /&gt; /* &lt;BR /&gt;  * Wait for the thread to finish executing, then...&lt;BR /&gt;  */&lt;BR /&gt; return_val = pthread_join(tid, (void **)NULL);&lt;BR /&gt; if (return_val != 0)&lt;BR /&gt;  fatal_error(return_val, "pthread_join()");&lt;BR /&gt;&lt;BR /&gt; /* Say Good-bye */&lt;BR /&gt; printf("Good-bye World!\n");&lt;BR /&gt; exit(0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/* Print error information, exit with -1 status. */&lt;BR /&gt;void&lt;BR /&gt;fatal_error(int err_num, char *function)&lt;BR /&gt;{&lt;BR /&gt; char *err_string;&lt;BR /&gt;&lt;BR /&gt; err_string = strerror(err_num);&lt;BR /&gt; fprintf(stderr, "%s error: %s\n", function, err_string);&lt;BR /&gt; exit(-1);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/* Function to print "Hello World!". */&lt;BR /&gt;void &lt;BR /&gt;thread1_func()&lt;BR /&gt;{&lt;BR /&gt;        printf("the thread is execuitng\n");&lt;BR /&gt;        sleep(30);&lt;BR /&gt; printf("Hello World!\n");&lt;BR /&gt; pthread_exit((void *)NULL);&lt;BR /&gt;}&lt;BR /&gt;&lt;/ERRNO.H&gt;&lt;/STDIO.H&gt;&lt;/STRING.H&gt;&lt;/PTHREAD.H&gt;</description>
    <pubDate>Wed, 11 Feb 2009 06:33:17 GMT</pubDate>
    <dc:creator>Emil Velez</dc:creator>
    <dc:date>2009-02-11T06:33:17Z</dc:date>
    <item>
      <title>pthread_create is failing in HP Unix server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355639#M684102</link>
      <description>I trying to execute the following program in the HP Unix server 11.11 but the following error message occurred.&lt;BR /&gt;&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: U_get_unwind_table (code) from /opt/langtools/lib/libpthread_tr.1&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: U_get_unwind_table (code) from /opt/langtools/lib/libpthread_tr.1&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: U_get_unwind_table (code) from /opt/langtools/lib/libpthread_tr.1&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: U_get_unwind_table (code) from /opt/langtools/lib/libpthread_tr.1&lt;BR /&gt;&lt;BR /&gt;Pid 4074 received a SIGSEGV for stack growth failure.&lt;BR /&gt;Possible causes: insufficient memory or swap space,&lt;BR /&gt;or stack size exceeded maxssiz.&lt;BR /&gt;^CSegmentation fault (core dumped)&lt;BR /&gt;&lt;BR /&gt;Source Code:&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;PTHREAD.H&gt;&lt;BR /&gt;#define NUM_THREADS 5&lt;BR /&gt;&lt;BR /&gt;void *PrintHello(void *threadid)&lt;BR /&gt;{&lt;BR /&gt;long tid;&lt;BR /&gt;tid = (long)threadid;&lt;BR /&gt;printf("Hello World! It's me, thread #%ld!\n", tid);&lt;BR /&gt;pthread_exit(NULL);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;pthread_t threads[NUM_THREADS];&lt;BR /&gt;int rc;&lt;BR /&gt;long t;&lt;BR /&gt;for(t=0;t&lt;NUM_THREADS&gt;&lt;/NUM_THREADS&gt;printf("In main: creating thread %ld\n", t);&lt;BR /&gt;rc = pthread_create(&amp;amp;threads[t], NULL, NULL, (void *)t);&lt;BR /&gt;if (rc){&lt;BR /&gt;printf("ERROR; return code from pthread_create() is %d\n", rc);&lt;BR /&gt;exit(-1);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;pthread_exit(NULL);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I used the following command for compilation.&lt;BR /&gt;&lt;BR /&gt;g++ -lpthread hello.cpp&lt;BR /&gt;&lt;BR /&gt;Please check and provide your feedback.&lt;/PTHREAD.H&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 10 Feb 2009 13:32:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355639#M684102</guid>
      <dc:creator>Venkata Subramanian R S</dc:creator>
      <dc:date>2009-02-10T13:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create is failing in HP Unix server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355640#M684103</link>
      <description>&amp;gt;dld.sl: Unresolved symbol: U_get_unwind_table /opt/langtools/lib/libpthread_tr.1&lt;BR /&gt;&lt;BR /&gt;This indicates you forgot to link with -lcl.  Any reason you are linking with the tracing libpthread?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;g++ -lpthread hello.cpp&lt;BR /&gt;&lt;BR /&gt;The -lpthread should go at the end, after the objects.  Also, doesn't g++ have a special option to indicate threading?</description>
      <pubDate>Tue, 10 Feb 2009 13:48:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355640#M684103</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-02-10T13:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create is failing in HP Unix server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355641#M684104</link>
      <description>&amp;gt;ME: doesn't g++ have a special option to indicate threading?&lt;BR /&gt;&lt;BR /&gt;That's -pthread.</description>
      <pubDate>Tue, 10 Feb 2009 22:25:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355641#M684104</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-02-10T22:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create is failing in HP Unix server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355642#M684105</link>
      <description>Probably want to write the program a little more systematically &lt;BR /&gt;&lt;BR /&gt;/* this is create.c  */&lt;BR /&gt;#include &lt;PTHREAD.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;ERRNO.H&gt;&lt;BR /&gt;&lt;BR /&gt;void  fatal_error(int err_num, char *function);&lt;BR /&gt;void  thread1_func();&lt;BR /&gt;&lt;BR /&gt;/* Print "Hello World!", then "Good-bye World!" */&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt; pthread_t tid;&lt;BR /&gt; int  return_val;&lt;BR /&gt;     printf("start of program \n");&lt;BR /&gt;     sleep(30);&lt;BR /&gt; /* &lt;BR /&gt;  * Create a new thread to execute thread1_func().&lt;BR /&gt;  */&lt;BR /&gt; return_val = pthread_create(&amp;amp;tid, (pthread_attr_t *)NULL,&lt;BR /&gt;        (void *(*)())thread1_func,&lt;BR /&gt;        (void *)NULL);&lt;BR /&gt; if (return_val != 0)&lt;BR /&gt;  fatal_error(return_val, "pthread_create()");&lt;BR /&gt;        printf("doing more work\n");&lt;BR /&gt;        sleep(30);&lt;BR /&gt;&lt;BR /&gt; /* &lt;BR /&gt;  * Wait for the thread to finish executing, then...&lt;BR /&gt;  */&lt;BR /&gt; return_val = pthread_join(tid, (void **)NULL);&lt;BR /&gt; if (return_val != 0)&lt;BR /&gt;  fatal_error(return_val, "pthread_join()");&lt;BR /&gt;&lt;BR /&gt; /* Say Good-bye */&lt;BR /&gt; printf("Good-bye World!\n");&lt;BR /&gt; exit(0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/* Print error information, exit with -1 status. */&lt;BR /&gt;void&lt;BR /&gt;fatal_error(int err_num, char *function)&lt;BR /&gt;{&lt;BR /&gt; char *err_string;&lt;BR /&gt;&lt;BR /&gt; err_string = strerror(err_num);&lt;BR /&gt; fprintf(stderr, "%s error: %s\n", function, err_string);&lt;BR /&gt; exit(-1);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/* Function to print "Hello World!". */&lt;BR /&gt;void &lt;BR /&gt;thread1_func()&lt;BR /&gt;{&lt;BR /&gt;        printf("the thread is execuitng\n");&lt;BR /&gt;        sleep(30);&lt;BR /&gt; printf("Hello World!\n");&lt;BR /&gt; pthread_exit((void *)NULL);&lt;BR /&gt;}&lt;BR /&gt;&lt;/ERRNO.H&gt;&lt;/STDIO.H&gt;&lt;/STRING.H&gt;&lt;/PTHREAD.H&gt;</description>
      <pubDate>Wed, 11 Feb 2009 06:33:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355642#M684105</guid>
      <dc:creator>Emil Velez</dc:creator>
      <dc:date>2009-02-11T06:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create is failing in HP Unix server</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355643#M684106</link>
      <description>try linking with libcl</description>
      <pubDate>Wed, 11 Feb 2009 12:03:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create-is-failing-in-hp-unix-server/m-p/4355643#M684106</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2009-02-11T12:03:48Z</dc:date>
    </item>
  </channel>
</rss>

