<?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 pthread_mutex in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-mutex/m-p/4760062#M657079</link>
    <description>Hi &lt;BR /&gt;&lt;BR /&gt;we are having problem when our program start on HP-UX 11.23 itanium.&lt;BR /&gt;Our program is ported from 11.0 and it is 32bit program running under aries.&lt;BR /&gt;&lt;BR /&gt;The program is using pthread_mutex library to be thread-safe under multithreading.&lt;BR /&gt;There are two threads Thread A and B.&lt;BR /&gt;The problem is... before finishing mutex initialization by pthread_init on Thread A, Thread B accesses the&lt;BR /&gt;exclusive area on thread A , and get Access Violation.&lt;BR /&gt;&lt;BR /&gt;The program create thread A and B in order, but when it is executed on fast processor,&lt;BR /&gt;thread B's execution is too fast. I am guessing that is why this problem is occurred.&lt;BR /&gt;This problem is only happens on application using initialization of pthread_mutex.&lt;BR /&gt;&lt;BR /&gt;When I encounter this problem, should I put "sleep" on thread B and wait for a second?&lt;BR /&gt;If anyone know if OS patch addressing above problem, let me know.&lt;BR /&gt;</description>
    <pubDate>Wed, 02 Mar 2011 09:14:55 GMT</pubDate>
    <dc:creator>katakura</dc:creator>
    <dc:date>2011-03-02T09:14:55Z</dc:date>
    <item>
      <title>pthread_mutex</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-mutex/m-p/4760062#M657079</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;we are having problem when our program start on HP-UX 11.23 itanium.&lt;BR /&gt;Our program is ported from 11.0 and it is 32bit program running under aries.&lt;BR /&gt;&lt;BR /&gt;The program is using pthread_mutex library to be thread-safe under multithreading.&lt;BR /&gt;There are two threads Thread A and B.&lt;BR /&gt;The problem is... before finishing mutex initialization by pthread_init on Thread A, Thread B accesses the&lt;BR /&gt;exclusive area on thread A , and get Access Violation.&lt;BR /&gt;&lt;BR /&gt;The program create thread A and B in order, but when it is executed on fast processor,&lt;BR /&gt;thread B's execution is too fast. I am guessing that is why this problem is occurred.&lt;BR /&gt;This problem is only happens on application using initialization of pthread_mutex.&lt;BR /&gt;&lt;BR /&gt;When I encounter this problem, should I put "sleep" on thread B and wait for a second?&lt;BR /&gt;If anyone know if OS patch addressing above problem, let me know.&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Mar 2011 09:14:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-mutex/m-p/4760062#M657079</guid>
      <dc:creator>katakura</dc:creator>
      <dc:date>2011-03-02T09:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_mutex</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-mutex/m-p/4760063#M657080</link>
      <description>&amp;gt;before finishing mutex initialization by pthread_init&lt;BR /&gt;&lt;BR /&gt;You should initialize mutexes before you start threads.&lt;BR /&gt;Or initialize them statically:&lt;BR /&gt;pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;If anyone know if OS patch addressing above problem&lt;BR /&gt;&lt;BR /&gt;Patches don't usually address programming errors.</description>
      <pubDate>Wed, 02 Mar 2011 09:38:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-mutex/m-p/4760063#M657080</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-02T09:38:10Z</dc:date>
    </item>
  </channel>
</rss>

