user3523105
user3523105

Reputation: 31

Why the PRI in "prstat" of Solaris is different from the priority for pthread_create

When I using prstat of Solaris to get the status of threads, I get following. One thing I could not understnd is that te PRI for each thread is totally different from my configuration to created these threads by pthread_create. I set the priority for sme thread to 10, but the PRI here shows totally different priority against that. Who can help answer my question. Is there any matching relationship between the PRI of prstat command and the parameter for pthread_create?

   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/LWPID      
  5874 mals      355M  313M run     32    0  20:09:58 4.1% epu1/26
  5874 mals      355M  313M sleep   54    0   8:50:39 1.8% epu1/36
  5874 mals      355M  313M sleep   59    0   2:13:10 1.5% epu1/40
  5874 mals      355M  313M sleep   44    0   2:25:36 1.5% epu1/37
  5874 mals      355M  313M sleep   59    0   5:21:01 1.1% epu1/24
  5874 mals      355M  313M sleep   59    0   5:21:00 1.1% epu1/22

Upvotes: 1

Views: 268

Answers (1)

jlliagre
jlliagre

Reputation: 30833

The priorities displayed by the prstat command are the current priorities of the threads.

Unless you are in the unlikely case of real time / fixed priorities threads, they continously vary depending on the scheduling class, the load, their respective usage, and so on.

It is then expected for these values to be different from the ones you set programmatically which are the static priority values.

Upvotes: 2

Related Questions