Re: help w/ mutex

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Slava M. Usov (stripit.slough_at_gmx.net)
Date: 05/05/04


Date: Wed, 5 May 2004 22:51:04 +0200


"Gary Chanson" <gchanson@No.Spam.TheWorld.net> wrote in message
news:eOIZmStMEHA.740@TK2MSFTNGP12.phx.gbl...

[...]

> Another reason to not use a semaphore in place of a mutex is the
> priority inversion problem. A semaphore can block a high priority thread
> while a lower priority thread executes, effectively lowering the priority
> of the high priority thread to that of the lower priority thread. Mutexes
> deal with this problem by temporarily raising the priority of the low
> priority thread to that of the higher priority thread while it is blocked.

Huh? Certainly not in win32. In win32, priority inversion is dealt with by
random thread boosting -- which stops working as you go into the real-time
class.

S



Relevant Pages

  • Re: Fastcode memory managers
    ... The lower priority thread owns the lock and the higher priority thread keeps ... This is a "live lock" as the CPU utilization is ...
    (borland.public.delphi.language.basm)
  • Re: threads
    ... Note the counter increment value and the quantum of time for each ... Higher priority thread executes and blocks waiting for a resource. ... lower priority thread to run and how? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Thread priority on multiprocessor system
    ... While a high priority thread runs on one processor, lower priority thread ... It means any synchronization schemes ... based on thread priorities will fail. ...
    (microsoft.public.vc.language)
  • Re: CriticalSection & Priority Inversion problem
    ... This means that when a high priority thread blocks on an object held by a ... threads blocks on something else while it has the lock on the CS. ...
    (microsoft.public.windowsce.embedded.vc)
  • threading
    ... Can a high priority thread intercept a lower priority thread in the middle ...
    (microsoft.public.dotnet.framework.compactframework)