public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.co.uk>
To: Christopher Friesen <cfriesen@nortel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: any fairness in NTPL pthread mutexes?
Date: Wed, 02 Nov 2005 17:47:18 +0000	[thread overview]
Message-ID: <4368FBA6.5040604@superbug.co.uk> (raw)
In-Reply-To: <43665B08.6040005@nortel.com>

Christopher Friesen wrote:
> 
> I'm using NPTL.
> 
> If I have a pthread mutex currently owned by a task, and two other tasks 
> try to lock it, when the mutex is unlocked, are there any rules about 
> the order in which the waiting tasks get the mutex (ie priority, FIFO, 
> etc.)?
> 
> Thanks,
> 
> Chris
> -

There is no fairness at all. It's currently not designed to be fair 
either. The reasons for this I can't remember, but there was talk at the 
KS about it and I just remember the answer. I think it had something to 
do with "If we implement fairness, general locking performance will drop 
and we prefer performance over fairness."

The solution is to modify your program so as not to rely on fairness.

James


  parent reply	other threads:[~2005-11-02 17:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-31 17:57 any fairness in NTPL pthread mutexes? Christopher Friesen
2005-10-31 18:06 ` Lee Revell
2005-10-31 22:09   ` Lee Revell
2005-10-31 19:09 ` Joe Seigh
2005-11-02 17:47 ` James Courtier-Dutton [this message]
2005-11-02 18:47   ` Lee Revell
     [not found] <53M7O-7Se-33@gated-at.bofh.it>
2005-11-01  3:52 ` Robert Hancock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4368FBA6.5040604@superbug.co.uk \
    --to=james@superbug.co.uk \
    --cc=cfriesen@nortel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox