<?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: problem about performance in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-about-performance/m-p/2565892#M725183</link>
    <description>Hi&lt;BR /&gt;  Performance of your program will improve if the threads are made to run different CPU.&lt;BR /&gt;  You can make use of the mpctl function in C to make the threads run on different CPU's&lt;BR /&gt;it is used as&lt;BR /&gt;mpctl(MPC_SETLWP,cpu,lwpid)&lt;BR /&gt;&lt;BR /&gt;Check man mpctl&lt;BR /&gt;Hope this helps...&lt;BR /&gt;&lt;BR /&gt;...BPK...&lt;BR /&gt;</description>
    <pubDate>Thu, 16 Aug 2001 06:21:45 GMT</pubDate>
    <dc:creator>Praveen Bezawada</dc:creator>
    <dc:date>2001-08-16T06:21:45Z</dc:date>
    <item>
      <title>problem about performance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-about-performance/m-p/2565891#M725182</link>
      <description>Thread A writes data into a queue which can be devided into N slots, &lt;BR /&gt;&lt;BR /&gt;thread B read from it.&lt;BR /&gt;If two semaphores of value 1 are associated with the queue, one for &lt;BR /&gt;&lt;BR /&gt;full and one for empty, then A and B can access the queue multual &lt;BR /&gt;&lt;BR /&gt;exclusively. On double CPU machine, this program has low performance.&lt;BR /&gt;If two semaphores of value N are associated with the queue, one for &lt;BR /&gt;&lt;BR /&gt;full slots and one for empty slots, A and B can access the queue &lt;BR /&gt;&lt;BR /&gt;simultaneously. But if B sem_wait(fcnt) and block, then A write data &lt;BR /&gt;&lt;BR /&gt;into the queue. At this time, B is runnable and waked up. Each time A &lt;BR /&gt;&lt;BR /&gt;write a data slot into the queue, context switch may occurs. It wastes &lt;BR /&gt;&lt;BR /&gt;a lot of CPU time.&lt;BR /&gt;How can I design the program so that the two threads can run &lt;BR /&gt;&lt;BR /&gt;simultaneously to use the two CPU, at the same time, context switch is &lt;BR /&gt;&lt;BR /&gt;not frequently ?&lt;BR /&gt;By the way, do I need to do something such as binding threads into &lt;BR /&gt;&lt;BR /&gt;individual CPU so that two threads can run simultaneously to use the &lt;BR /&gt;&lt;BR /&gt;two CPU ?</description>
      <pubDate>Thu, 16 Aug 2001 06:03:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-about-performance/m-p/2565891#M725182</guid>
      <dc:creator>Victor.Lin</dc:creator>
      <dc:date>2001-08-16T06:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: problem about performance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-about-performance/m-p/2565892#M725183</link>
      <description>Hi&lt;BR /&gt;  Performance of your program will improve if the threads are made to run different CPU.&lt;BR /&gt;  You can make use of the mpctl function in C to make the threads run on different CPU's&lt;BR /&gt;it is used as&lt;BR /&gt;mpctl(MPC_SETLWP,cpu,lwpid)&lt;BR /&gt;&lt;BR /&gt;Check man mpctl&lt;BR /&gt;Hope this helps...&lt;BR /&gt;&lt;BR /&gt;...BPK...&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Aug 2001 06:21:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-about-performance/m-p/2565892#M725183</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2001-08-16T06:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: problem about performance</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-about-performance/m-p/2565893#M725184</link>
      <description>Why I could not find the button th assign the point ?&lt;BR /&gt;I am very sorry.</description>
      <pubDate>Thu, 23 Aug 2001 01:43:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-about-performance/m-p/2565893#M725184</guid>
      <dc:creator>Victor.Lin_1</dc:creator>
      <dc:date>2001-08-23T01:43:38Z</dc:date>
    </item>
  </channel>
</rss>

