<?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 fails when used with pthread_attr_setinheritsched() on HPUX in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925141#M97284</link>
    <description>yes i have called this API&lt;BR /&gt;pthread_attr_init()&lt;BR /&gt;&lt;BR /&gt;I have also read the rtsched(2)&lt;BR /&gt;which gives me info about these &lt;BR /&gt; &lt;BR /&gt;sched_get_priority_max()&lt;BR /&gt;sched_get_priority_min()&lt;BR /&gt;PRI_HPUX_TO_POSIX()&lt;BR /&gt;PRI_POSIX_TO_HPUX()&lt;BR /&gt;&lt;BR /&gt;which are significant in my program i guess.&lt;BR /&gt;But still I am facing the problem.&lt;BR /&gt;&lt;BR /&gt;I have found one more interesting thing about&lt;BR /&gt;sched_param structure which is something like this in HPUX&lt;BR /&gt;&lt;BR /&gt;struct sched_param {&lt;BR /&gt;        int     sched_priority;    /* Process execution scheduling priority. */&lt;BR /&gt;        int     sched_reserved[7]; /* Reserved fields for future expansion. */&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and for AIX and solaris&lt;BR /&gt;&lt;BR /&gt;struct sched_param&lt;BR /&gt;{&lt;BR /&gt;        int      sched_priority;&lt;BR /&gt;        int      sched_policy;&lt;BR /&gt;        int      sched_reserved[6];&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;on solaris&lt;BR /&gt;&lt;BR /&gt;struct sched_param {&lt;BR /&gt;        int     sched_priority; /* process execution scheduling priority */&lt;BR /&gt;        int     sched_nicelim;  /* nice value limit for SCHED_OTHER policy */&lt;BR /&gt;        int     sched_nice;     /* nice value for SCHED_OTHER policy */&lt;BR /&gt;        int     sched_pad[6];   /* pad to the same size as pcparms_t of */&lt;BR /&gt;                                /* sys/priocntl.h */&lt;BR /&gt;                                /*      sizeof(sched_priority) +        */&lt;BR /&gt;                                /*      sizeof(pcparms_t.pc_clparms)    */&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;here as you can see i can set policy in this structure something like this&lt;BR /&gt;&lt;BR /&gt;struct sched_param sched_param={1,1,1};&lt;BR /&gt;&lt;BR /&gt;but in HPUX i am using sched_param sched_param={1}&lt;BR /&gt;&lt;BR /&gt;this only sets the first parameter which is scheduling priority. As you have asked me whether I am setting the policy or not my answer is no, I am not setting it.&lt;BR /&gt;please suggest something.</description>
    <pubDate>Fri, 19 Jan 2007 04:57:01 GMT</pubDate>
    <dc:creator>jeet_xp</dc:creator>
    <dc:date>2007-01-19T04:57:01Z</dc:date>
    <item>
      <title>pthread_create fails when used with pthread_attr_setinheritsched() on HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925138#M97281</link>
      <description>I am using HPUX on Itanium and I have c program where I am doing something like this&lt;BR /&gt;but this pthread_create always fails at runtime&lt;BR /&gt;prio = PRI_MAX;&lt;BR /&gt;prio_low = PRI_MIN;&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;struct sched_param sched_param={1};&lt;BR /&gt;sched_param.sched_priority=prio;&lt;BR /&gt;thret = pthread_attr_setschedparam(&amp;amp;serv_attr, &amp;amp;sched_param);&lt;BR /&gt;&lt;BR /&gt;thret = pthread_attr_setinheritsched(&amp;amp;serv_attr,PTHREAD_EXPLICIT_SCHED);&lt;BR /&gt;&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;thret = pthread_create(&amp;amp;sthread,&amp;amp;serv_attr,server_main, 0);&lt;BR /&gt;The error code for a user it EPERM and for root it is EINVAL.&lt;BR /&gt;but if i remove this line&lt;BR /&gt;&lt;BR /&gt;thret = pthread_attr_setinheritsched(&amp;amp;serv_attr,PTHREAD_EXPLICIT_SCHED);&lt;BR /&gt;&lt;BR /&gt;it works fine, can anyone suggest whats happening here. I have tried the same code on AIX and Solaris without any changes, it works there.</description>
      <pubDate>Fri, 12 Jan 2007 01:33:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925138#M97281</guid>
      <dc:creator>jeet_xp</dc:creator>
      <dc:date>2007-01-12T01:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails when used with pthread_attr_setinheritsched() on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925139#M97282</link>
      <description>&lt;P&gt;Have you called pthread_attr_init?&lt;BR /&gt;&lt;BR /&gt;Why are you using {1} above? It is illegal to hardcode constants. Did you mean to use SCHED_RR?&lt;BR /&gt;&lt;BR /&gt;Both EPERM and EINVAL seem to point out that your scheduling values isn't valid:&lt;BR /&gt;[EPERM] The caller does not have the appropriate privileges to create a thread with the scheduling policy and parameters specified in attr.&lt;BR /&gt;&lt;BR /&gt;[EINVAL] The scheduling policy or scheduling attributes specified in attr are invalid.&lt;BR /&gt;&lt;BR /&gt;Have you read rtsched(2)?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2011 00:38:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925139#M97282</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-22T00:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails when used with pthread_attr_setinheritsched() on HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925140#M97283</link>
      <description>Or at the very least, unwise to ass-u-me that different OSes will have the same values for constants of the same name, unless those values are specified by a de jure standard.&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Jan 2007 21:04:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925140#M97283</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2007-01-12T21:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails when used with pthread_attr_setinheritsched() on HPUX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925141#M97284</link>
      <description>yes i have called this API&lt;BR /&gt;pthread_attr_init()&lt;BR /&gt;&lt;BR /&gt;I have also read the rtsched(2)&lt;BR /&gt;which gives me info about these &lt;BR /&gt; &lt;BR /&gt;sched_get_priority_max()&lt;BR /&gt;sched_get_priority_min()&lt;BR /&gt;PRI_HPUX_TO_POSIX()&lt;BR /&gt;PRI_POSIX_TO_HPUX()&lt;BR /&gt;&lt;BR /&gt;which are significant in my program i guess.&lt;BR /&gt;But still I am facing the problem.&lt;BR /&gt;&lt;BR /&gt;I have found one more interesting thing about&lt;BR /&gt;sched_param structure which is something like this in HPUX&lt;BR /&gt;&lt;BR /&gt;struct sched_param {&lt;BR /&gt;        int     sched_priority;    /* Process execution scheduling priority. */&lt;BR /&gt;        int     sched_reserved[7]; /* Reserved fields for future expansion. */&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and for AIX and solaris&lt;BR /&gt;&lt;BR /&gt;struct sched_param&lt;BR /&gt;{&lt;BR /&gt;        int      sched_priority;&lt;BR /&gt;        int      sched_policy;&lt;BR /&gt;        int      sched_reserved[6];&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;on solaris&lt;BR /&gt;&lt;BR /&gt;struct sched_param {&lt;BR /&gt;        int     sched_priority; /* process execution scheduling priority */&lt;BR /&gt;        int     sched_nicelim;  /* nice value limit for SCHED_OTHER policy */&lt;BR /&gt;        int     sched_nice;     /* nice value for SCHED_OTHER policy */&lt;BR /&gt;        int     sched_pad[6];   /* pad to the same size as pcparms_t of */&lt;BR /&gt;                                /* sys/priocntl.h */&lt;BR /&gt;                                /*      sizeof(sched_priority) +        */&lt;BR /&gt;                                /*      sizeof(pcparms_t.pc_clparms)    */&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;here as you can see i can set policy in this structure something like this&lt;BR /&gt;&lt;BR /&gt;struct sched_param sched_param={1,1,1};&lt;BR /&gt;&lt;BR /&gt;but in HPUX i am using sched_param sched_param={1}&lt;BR /&gt;&lt;BR /&gt;this only sets the first parameter which is scheduling priority. As you have asked me whether I am setting the policy or not my answer is no, I am not setting it.&lt;BR /&gt;please suggest something.</description>
      <pubDate>Fri, 19 Jan 2007 04:57:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925141#M97284</guid>
      <dc:creator>jeet_xp</dc:creator>
      <dc:date>2007-01-19T04:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails when used with pthread_attr_setinheritsched() on HP-UX</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925142#M97285</link>
      <description>&lt;P&gt;&amp;gt;I have also read the rtsched(2) which gives me info about these&lt;BR /&gt;sched_get_priority_max() sched_get_priority_min()&lt;BR /&gt;&lt;BR /&gt;If you read this and used SCHED_HPUX, with some fiddling, it would indicate that you can't use {1} above but you must use a value between:&lt;BR /&gt;Min pri: -256, max pri: -129&lt;BR /&gt;&lt;BR /&gt;I needed to be root to use -129, or any other value.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2011 00:39:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-when-used-with-pthread-attr-setinheritsched/m-p/3925142#M97285</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-22T00:39:34Z</dc:date>
    </item>
  </channel>
</rss>

