lkml.org 
[lkml]   [2005]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: any fairness in NTPL pthread mutexes?
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-02 18:49    [W:0.876 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site