My vote is B.


From: Steven Dufresne <community-noreply@qnx.com>
Sent: April 22, 2021 2:57:41 PM
To: ostech-core_os
Subject: Mutex priority inheritance related question
 
Here's a question that came up while teaching priority inheritance w.r.t. mutex locking in class today...

Let's say thread A is RUNNING and B is READY both at priority 21 on a single core system. We also have C at priority 10 with a mutex locked. Thread A calls pthread_mutex_lock() to lock that mutex. A of course MUTEX blocks and C's priority is bumped up to 21. The question is who runs when C unlocks the mutex, A or B? B is next in the list but will A be moved to the head of the list and run instead?

Thanks,
Steve



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post121391
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com