lkml.org 
[lkml]   [2006]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: sched_yield() makes OpenLDAP slow
Helge Hafting writes:

[...]

>
> >nothing says that it can't call pthread_mutex_lock and re-acquire the mutex
> >before any other thread gets around to getting it.
> >
> >
> Wrong.
> The spec says that the mutex must be given to a waiter (if any) at the
> moment of release. The waiter don't have to be scheduled at that
> point, it may keep sleeping with its freshly unlocked mutex. So the
> unlocking thread may continue - but if it tries to reaquire the mutex
> it will find the mutex taken and go to sleep at that point. Then other

You just described a convoy formation: a phenomenon that all reasonable
mutex implementation try to avoid at all costs. If that's what standard
prescribes---the standard has to be amended.

>
> Helge Hafting

Nikita.
-
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: 2006-01-26 11:52    [W:0.119 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site