HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Questions about HP-UX 11i process and thread prior...
Operating System - HP-UX
1834631
Members
3132
Online
110069
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2005 02:51 AM
02-17-2005 02:51 AM
Questions about HP-UX 11i process and thread priorities
Hi. I read the relevant sections from the book "HP-UX 11i Internals" and I still have some questions:
I understand how to calculate the user-level priority using the formula:
new priority = (puser + kt_cpu/4) - 2 * (pnice - p_nice)
Scenario: Program 'foo' running at niceness of 20 has 3 threads. Thread #0 is in an infinite usleep() loop. Threads #1 and #2 are simply spinning in a loop while printing a counter to stdout.
Using pstat_getlwps() I have the following snapshot:
thread #0: lwp_pri = 168, lwp_cpu = 0
thread #1: lwp_pri = 241, lwp_cpu = 255
thread #2: lwp_pri = 241, lwp_cpu = 255
all 3 threads have lwp_schedpolicy = 1 (PS_TIMESHARE)
Plugging 'lwp_cpu' in for 'kt_cpu' in the above formula, I can calculate the following:
thread #0 priority: 178
thread #1 priority: 241
thread #2 priority: 241
So, for threads #1 and #2, my calculated priorities match those in 'lwp_pri'. But it doesn't match for thread #0 even though the scheduler is the same.
Also, using pstat_getproc() to query the whole process, I find the following:
pst_pri = 152
pst_schedpolicy = 1 (PS_TIMESHARE)
I'm not sure how to interpret the priority of 152. That seems awfully strong (according to the book, this falls into the range of system priorities that delay incoming signals). In fact, a quick glance at ps -l output shows most processes with a priority of 154 or below.
My question: assuming the above formula is correct, what is the relation between the priorities computed by the formula and the 'lwp_pri' and 'pst_pri' priorities returned by the pstat functions? There seem to be some discrepencies.
I understand how to calculate the user-level priority using the formula:
new priority = (puser + kt_cpu/4) - 2 * (pnice - p_nice)
Scenario: Program 'foo' running at niceness of 20 has 3 threads. Thread #0 is in an infinite usleep() loop. Threads #1 and #2 are simply spinning in a loop while printing a counter to stdout.
Using pstat_getlwps() I have the following snapshot:
thread #0: lwp_pri = 168, lwp_cpu = 0
thread #1: lwp_pri = 241, lwp_cpu = 255
thread #2: lwp_pri = 241, lwp_cpu = 255
all 3 threads have lwp_schedpolicy = 1 (PS_TIMESHARE)
Plugging 'lwp_cpu' in for 'kt_cpu' in the above formula, I can calculate the following:
thread #0 priority: 178
thread #1 priority: 241
thread #2 priority: 241
So, for threads #1 and #2, my calculated priorities match those in 'lwp_pri'. But it doesn't match for thread #0 even though the scheduler is the same.
Also, using pstat_getproc() to query the whole process, I find the following:
pst_pri = 152
pst_schedpolicy = 1 (PS_TIMESHARE)
I'm not sure how to interpret the priority of 152. That seems awfully strong (according to the book, this falls into the range of system priorities that delay incoming signals). In fact, a quick glance at ps -l output shows most processes with a priority of 154 or below.
My question: assuming the above formula is correct, what is the relation between the priorities computed by the formula and the 'lwp_pri' and 'pst_pri' priorities returned by the pstat functions? There seem to be some discrepencies.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2005 03:45 AM
02-17-2005 03:45 AM
Re: Questions about HP-UX 11i process and thread priorities
that part in the book only made my head feel strange :)
I could only guess that the looping without real processing happing somehow gets the threads a too high priority.
i'm getting that feeling again.
I could only guess that the looping without real processing happing somehow gets the threads a too high priority.
i'm getting that feeling again.
yesterday I stood at the edge. Today I'm one step ahead.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP