Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: VDR 1.3.12 buffer optimizations - SOLVED!



On 10 Oct 2004 Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de> wrote:

> - Changed cCondVar to avoid a possible "near miss" condition (thanks to Sascha
>   Volkenandt for pointing out this one). cCondVar now uses its own mutex and
>   thus has a different calling interface. Plugins using cCondVar will need to
>   be modified.

I appreciate your work, but I must admit that I'm not very happy
with your change here.

Your changes make it impossible to use the condvar as decribed
in the pthread man pages and degrades the cCondVar class to
something like a simple wait-on-signal.

Main reason for this is the (new) internal handling of the
mutex. According to the man pages, the mutex has to be aquired
before checking the condition (i.e. outside cCondVar). In this
context condition doesn't means your "signaled" var, but some
custom var which has to be checked against a certain value or
checking for a completed operation. This is impossible with your
new code.

The old code was perfectly in sync with the man pages and if
used in the correct way, no "near-miss" could ever happen. If
you observed "near-miss" situations, you most certainly failed
to do a propper mutex handling.

My plugins uses cCondVar in an extensive way and due to the
things said above, the code cannot be adopted.

Please consider to keep the old cCondVar stuff in a backward
compatible way (if not for vdr needs, so at least for the
plugins).

Regards.

-- 
Stefan Huelswitt
s.huelswitt@gmx.de  | http://www.muempf.de/




Home | Main Index | Thread Index