IBM Support

Setting thread priority and thread policy with IBM Rhapsody on the Linux operating system

Question & Answer


Question

How do you set the Linux thread priority in IBM Rhapsody?

Cause

You are setting the CG.Class.ActiveThreadPriority property but the property appears to have no effect and the thread priority does not change when the executable is run.

Answer

The CG.Class.ActiveThreadPriority property will set the thread priority using    
POSIX API method pthread_setschedparam (see LinuxThread::setPriority()  
in Share/LangCpp/oxf/LinuxOS.cpp) but the Linux OS will ignore this priority as the thread
scheduling scheme is set to the default SCHED_OTHER policy.             
                                                                        
Therefore, it is the user's responsibility to explicitly and directly   
change the scheduling policy. Once changed to a real time 
scheduling policy the ActiveThreadPriority property will take effect.   
Note that the specific system thread priority range should be checked  
with sched_get_priority_min and sched_get_priority_max. Also, note that 
some of the scheduling policies such as SCHED_FIFO and SCHED_RR require 
root permission on the running thread.    

Further information can be found in the POSIX API documentation.                           

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF016","label":"Linux"}],"Version":"8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.5;8.0.6;8.1;8.1.1;8.1.2;8.1.2.1;8.1.3;8.1.4;8.1.5;8.2;8.2.1;8.3","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg22013129