[haiku-development] Re: Proposing kernel patch: mutexes/priorities
- From: Stephan Aßmus <superstippi@xxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Thu, 01 Mar 2012 22:08:27 +0100
Am 01.03.2012 21:33, schrieb Clemens Zeidler:
On Fri, 02 Mar 2012 05:43:09 +1300, Julian Harnath <julian.harnath@xxxxxxxxxxxxxx> wrote:The priority boosting works as follows: if a thread A with priority X holds a mutex and another thread B with priority Y tries to acquire it, and Y > X, then the priority of A gets temporarily boosted to Y+1. As soon as A releases the mutex it gets back its old priority X. (except A still holds more mutexes with higher-priority threads waiting.. then it gets the priority of the next-highest-priority waiter plus one).sounds reasonable to me to solve this problem but maybe its even better to temporary reduce the priority of B to X-1? Otherwise you make A the super thread that might block the rest of the system for a very long time? E.g. A could hold the lock forever and thus do everything with the higher priority.
I think the blocking high priority thread is not the problem, since it isn't scheduled while it is blocking. But other high priority threads may prevent the low priority thread from completing fast enough. It wouldn't help to lower the priority of the blocking thread.
In any case, I don't think that the problem you describe is real. If it's holding a lock forever with low priority, then you are screwed regardless, when it means other threads waiting for the lock can't run. :-)
But I better shut up now, I am pretty clueless with kernel stuff... Best regards, -Stephan
- Follow-Ups:
- [haiku-development] Re: Proposing kernel patch: mutexes/priorities
- From: Robert Stiehler
- [haiku-development] Re: Proposing kernel patch: mutexes/priorities
- From: clemens . zeidler
- [haiku-development] Re: Proposing kernel patch: mutexes/priorities
- References:
- [haiku-development] Proposing kernel patch: mutexes/priorities
- From: Julian Harnath
- [haiku-development] Re: Proposing kernel patch: mutexes/priorities
- From: Clemens Zeidler
- [haiku-development] Proposing kernel patch: mutexes/priorities
Other related posts:
- » [haiku-development] Proposing kernel patch: mutexes/priorities - Julian Harnath
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - Clemens Zeidler
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - Stephan Aßmus
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - David Given
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - Robert Stiehler
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - pulkomandy
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - clemens . zeidler
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - Julian Harnath
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - Julian Harnath
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - Gabriel Harrison
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - Pete Goodeve
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - Pete Goodeve
- » [haiku-development] Re: Proposing kernel patch: mutexes/priorities - Julian Harnath