Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c++ multithread code setting priority level to different threads [duplicate]

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?

like image 740
Daniel Avatar asked Jul 14 '26 09:07

Daniel


1 Answers

You can use pthread_setschedparam to set the priority of the thread

like image 193
parapura rajkumar Avatar answered Jul 17 '26 20:07

parapura rajkumar