[MPlayer-dev-eng] threaded cache
Andrej N. Gritsenko
andrej at rep.kiev.ua
Sun Nov 27 17:20:12 CET 2011
Hello!
On Sun, Nov 27, 2011, around 17:56, Reimar Döffinger wrote:
>I read about everything I could find about it.
>My conclusion is that pthread_cond_timedwait is full of race conditions,
>even on systems that _do_ support a monotonic clock that it is
>completely unusable if you actually need to rely on the timeout.
>Or to write it in bold:
>THERE IS NO WAY TO USE pthread_cond_timedwait CORRECTLY.
Just my 5 cents.
I don't know what exactly you've read but I use that POSIX function
pthread_cond_timedwait() in application with multiple streams and I have
no problems with it as time isn't main its purpose at all, only usage of
the time flow in such function is to return from it after some period of
time but main purpose of it is to wait for external event (such as cache
request). In many cases it is possible to replace pthread_cond_timedwait
with pthread_cond_wait. It's absolutely irrelevant to any realtime or
monotonic clock is what I mean. :)
With best wishes.
Andriy.
More information about the MPlayer-dev-eng
mailing list