Possible Duplicate:
How to increase thread priority in pthreads?
I have a multithread code written in C++ using pthread. basically I have a main thread doing critical work and another thread doing maintenance. I'm wondering if there is a way to set a lower priority in the second thread so it runs when the first one is not busy?