I am working on a program that suffers from hunger when one thread does more work than another. The critical section is protected by reentrant QMutex, which is not fair.
In Java, you can specify an equity option to block. Does C ++ (or acceleration libraries) have an accessible reentrant lock available? Preferably up to C ++ 11.
I used to do some research, boost has share_lock, but I don't need a read / write lock. Just a lock that ensures that every thread has an equal chance of entering a critical section.
Thank you very much.
source share