<?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: processes vs threads in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369351#M867729</link>
    <description>When a process is using threads the threadsafe functions in system libraries need to use mutex operations to protect all of their critical sections that access global data.  That can add a lot of overhead to those functions.&lt;BR /&gt;&lt;BR /&gt;I have never been a fan of threads.  The implicit sharing of almost every process resource is both expensive because of access synchronization and risky because of the requirement for a programmer to identify every critical section.  It gets even worse when application authors are tempted to use third party libraries that may or may not be threadsafe.&lt;BR /&gt;&lt;BR /&gt;I feel that most applications that use threading would be better off using a stable pool of processes with explicit allocation of shared memory and interprocess communication.&lt;BR /&gt;That confines the cost and risk of shared resources to small specific regions of code.&lt;BR /&gt;&lt;BR /&gt;It isn't fashionable.  But it is good engineering.</description>
    <pubDate>Wed, 01 Sep 2004 10:54:11 GMT</pubDate>
    <dc:creator>Mike Stroyan</dc:creator>
    <dc:date>2004-09-01T10:54:11Z</dc:date>
    <item>
      <title>processes vs threads</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369346#M867724</link>
      <description>Does anyone know why a process with 2 threads is slower then 2 processes with a single thread?</description>
      <pubDate>Tue, 31 Aug 2004 14:28:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369346#M867724</guid>
      <dc:creator>Todd Bell</dc:creator>
      <dc:date>2004-08-31T14:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: processes vs threads</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369347#M867725</link>
      <description>Hi Todd,&lt;BR /&gt;&lt;BR /&gt;In theory there shouldn't be any difference *as long as* they're doing the same thing.&lt;BR /&gt;The system should treat them the same.&lt;BR /&gt;Each process OR thread is a scheduable, runnable entity that requires it's own kernel stack, user area, etc.&lt;BR /&gt;The difference should boil down to what kind of work &amp;amp; what else is required (disk I/O, Net I/O, etc.) to get that work done as well as how the work is getting done. It's amazing to see the performance difference caused by using the 3 different kinds of fork()s available.&lt;BR /&gt;A.T.&amp;amp; T's original fork(). The BSD new &amp;amp; improved vfork(). And the HP copy-on-write in the parent &amp;amp; copy-on-access in the child fork().&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 31 Aug 2004 14:43:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369347#M867725</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2004-08-31T14:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: processes vs threads</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369348#M867726</link>
      <description>It doesn't seem to be the case.  I've taken a test process that has no threads and simply linked in the pthread library (still not using any threads).  The processing time doubled.  The test program simply perfomed calculations in a loop.&lt;BR /&gt;&lt;BR /&gt;pthread library seems to be the biggest culprit in threading performance degradation?</description>
      <pubDate>Tue, 31 Aug 2004 15:05:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369348#M867726</guid>
      <dc:creator>Todd Bell</dc:creator>
      <dc:date>2004-08-31T15:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: processes vs threads</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369349#M867727</link>
      <description>How many processors you have in the system ? - I may not be able to explain the reasons for the pthread() behaviour. which is the OS version ? 10.20 or 11.x. Only from 11.0 , HP-UX supported Kernel threads and thus you would see significant performance incentive for threading your application.</description>
      <pubDate>Tue, 31 Aug 2004 15:18:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369349#M867727</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-08-31T15:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: processes vs threads</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369350#M867728</link>
      <description>6 processors, hpux 11.0&lt;BR /&gt;On top of the pthread test.  I've noticed in less isolated cases that running a process with multiple threads is less efficient then multi processes with a single thread (with the same work).  This could be RW's threading implementation or something else.  But my isolated test of adding pthread library was very significant.  Thanks.</description>
      <pubDate>Tue, 31 Aug 2004 15:37:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369350#M867728</guid>
      <dc:creator>Todd Bell</dc:creator>
      <dc:date>2004-08-31T15:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: processes vs threads</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369351#M867729</link>
      <description>When a process is using threads the threadsafe functions in system libraries need to use mutex operations to protect all of their critical sections that access global data.  That can add a lot of overhead to those functions.&lt;BR /&gt;&lt;BR /&gt;I have never been a fan of threads.  The implicit sharing of almost every process resource is both expensive because of access synchronization and risky because of the requirement for a programmer to identify every critical section.  It gets even worse when application authors are tempted to use third party libraries that may or may not be threadsafe.&lt;BR /&gt;&lt;BR /&gt;I feel that most applications that use threading would be better off using a stable pool of processes with explicit allocation of shared memory and interprocess communication.&lt;BR /&gt;That confines the cost and risk of shared resources to small specific regions of code.&lt;BR /&gt;&lt;BR /&gt;It isn't fashionable.  But it is good engineering.</description>
      <pubDate>Wed, 01 Sep 2004 10:54:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369351#M867729</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2004-09-01T10:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: processes vs threads</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369352#M867730</link>
      <description>Arguing "threads vs processes" is no different than "SMP vs clusters of uniprocessors". Both arguments are essentially pointless and foolish. Each strategy has its own unique advantages and disadvantages, and substantial overlap in the middle. Your level of familiarity and comfort with each may be a legitimate (and even large) part of your decision; but to presume it's unreasonable for someone else to make the opposite decision is unfair.&lt;BR /&gt;&lt;BR /&gt;As has been pointed out, enabling multiple threads in a process brings overhead. If you're not EXPLOITING the ADVANTAGES of multithreading in the process, then that overhead is clearly visible as a performance cost. This is like hooking an enormous trailer onto your car without actually carrying anything, and complaining that your gas mileage has suffered even though you're not USING the trailer. You probably wouldn't even think of doing that: so don't think of hooking threads to your process without using them.&lt;BR /&gt;&lt;BR /&gt;A comparison between "a process with 2 threads" and "2 processes" is inherently flawed because it's not possible for both cases to be running identical code. There are differences, and probably SUBSTANTIAL differences, between those two programs that are not expressed in the description. They may accomplish the same thing, but they still do it in vastly different ways. (And in fact, if they DON'T, then one or the other is simply wrong and that may well explain the differences...)</description>
      <pubDate>Wed, 01 Sep 2004 12:07:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/processes-vs-threads/m-p/3369352#M867730</guid>
      <dc:creator>David Butenhof</dc:creator>
      <dc:date>2004-09-01T12:07:25Z</dc:date>
    </item>
  </channel>
</rss>

