Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7971483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:39:03+00:00 2026-06-04T07:39:03+00:00

I have created two threads . By default they have a priority of 0

  • 0

I have created two threads . By default they have a priority of 0 which i can see using
pthread_getschedparam and then i try to increase their priority to say 2 and 3 respectively . But Whn i try do do so i get an error

     error setting priority for T1: (1), Operation not permitted
     error setting priority for T2: (1), Operation not permitted 

I have used the scheduling policy of SCHED_RR for them

       int sched = SCHED_RR;

and then performed this :-

   if (pthread_setschedparam(t1, sched, &t1_param) != 0) 
  {
     std::cout << "error setting priority for T1: (" << errno << "), " << 
     strerror(errno) << std::endl;
  }

What is the reason why I am not able to modify my threads priority because priority is within limit of 1 to 99 for SCHED_RR.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:39:04+00:00Added an answer on June 4, 2026 at 7:39 am

    DISCLAIMER: I’m not an expert at Linux security, and the following advice might compromise or damage your computer.

    In recent versions of Linux, there is a resource limit, RLIMIT_RTPRIO, which specifies the maximum real-time priority you can use. You can check this from the shell:

    > ulimit -r
    0
    

    On my version of Ubuntu (and probably yours too) there’s also a hard limit of zero, so you can’t simply use ulimit or setrlimit to raise this. One way to raise the hard limit is to add a line to /etc/security/limits.conf like this (replacing <username> with your username):

    <username> hard rtprio 99
    

    Then you should be able to use ulimit (from the shell) or setrlimit (from your program) to set the soft limit to the priority you need; alternatively, you could set that automatically by adding a second line to limits.conf, replacing hard with soft.

    > ulimit -Hr # show hard limit
    99
    > ulimit -r
    0
    > ulimit -Sr 1 # set soft limit
    > ulimit -r
    1
    

    Do be careful running programs with real-time priority; it can kill the system if it starts misbehaving.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created two threads and i want to see their priority after they
I have created a package using PackageMaker and want to change the default icon
I am new to Objective C programming. I have created two threads called add
I created two threads and using a single instance of class called the static
Let's imagine I have two threads which execute some database-oriented code in thread-specific TransactionScopes
Basically I have created two MATLAB functions which involve some basic signal processing and
I have created two forms in my Windows Application. One Form acts as a
I have created two files: tunables.h #ifndef TUNABLES_H #define TUNABLES_H void tunables_load_conservative(); void tunables_load_aggressive();
I have created two JavaScript files. One file is "validators.js" and the other is
I have created two viewController classes such that one is superclass of another.i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.