LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   mutext lock - based on thread priority? (http://www.linuxquestions.org/questions/linux-kernel-70/mutext-lock-based-on-thread-priority-4175426506/)

sreejeshs 09-10-2012 07:28 AM

mutext lock - based on thread priority?
 
Hi,
I have a process having more than one threads. I want to allocate a resource based on thread priority. Thread scheduling policy is SCHED_RR.

I want to ensure that mutex locking in linux is based on thread priority(one process)? Or first come first serve?

What should i do if not?

Thank you

sundialsvcs 09-10-2012 08:38 AM

As far as I know, mutex locking is round-robin because, if it were not, high-priority threads would "starve" lower-priority ones.

If you have a "complicated" schedule contention requirement, as you may well have in a real-time application, you may need to build a more sophisticated marshaling algorithm than mutexes alone will provide.


All times are GMT -5. The time now is 05:31 AM.