thread priority

can i change the priority of a thread which is currently runnning?
ie if athread is presently running at priority 10, can i change its
priority to 15?

“tisa” <ruxyz@yahoo.com> wrote in message
news:bacb2t$s6f$1@tiger.openqnx.com

can i change the priority of a thread which is currently runnning?
ie if athread is presently running at priority 10, can i change its
priority to 15?

Yes, but if the thread is to set its own priority it can only do it if can
get a chance to run.

Hence if a thread at priority 2 never gets to run because another thread at
priority 3 is using 100% of the CPU, it will never get a chance to execute
the code that changes the priority. Another thread/process will have to do
it.