thr_setprio() fails to raise thread priority for the process. (Doc ID 1527048.1)

Last updated on AUGUST 03, 2016

Applies to:

Solaris SPARC Operating System - Version 11 and later
Information in this document applies to any platform.

Symptoms

A program that is working on Solaris 10 fails on Solaris 11 because it is not able to raise its access level to the scheduler using the thr_setprio(3C) function.

 

Example compilation commands:
--------------------
# cc -mt -o thread_issue thread_issue.c

It works on Solaris 10 SPARC system:
-----------------------------------
# uname -a
SunOS OnSolaris10 5.10 Generic_142909-17 sun4v sparc sun4v

# ./thread_issue
sub_a :try to set thread priority to priority:0
Main:Successfully Created threads A:2
sub_a: successfully set thread priority to prioity:0
sub_a :try to set thread priority to priority:127
sub_a: successfully set thread priority to priority:127
Main:exiting…

But fails on Solaris 11 SPARC system:
------------------------------------

# uname -a
SunOS OnSolaris11 5.11 11.0 sun4v sparc sun4v

# ./thread_issue
sub_a :try to set thread priority to priority:0
Main:Successfully Created threads A:2
sub_a: successfully set thread priority to priority:0
sub_a :try to set thread priority to priority:127
!!!!! sub_a:can't set thread priority to priority:127 error code :22

Changes

Moving to Solaris 11.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms