Mailing List archive

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

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



Stefan Huelswitt wrote:
> 
> 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).

Well, since cCondVar was only used as a simple handshake machanism
between two threads inside VDR I thought this change might not hurt.
Apparently I was wrong ;-)

I'll restore the original cCondVar in the official 1.3.13 and make a
new, simpler class for VDR's own needs. For the moment, if you feel
like it, you could just rename cCondVar to something else inside VDR
and insert the original cCondVar code into thread.[hc]. 

Sorry for the inconvenience. Right now the main focus however, should
be on the buffer handling, anyway, which I believe is greatly improved
with this patch.

Klaus




Home | Main Index | Thread Index