Mailing List archive

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

[vdr] Re: Video Disk Recorder version 1.0.1



On Monday 22 April 2002 12:45, Dr. Werner Fink wrote:
> On Sun, Apr 21, 2002 at 08:19:42PM +0200, Andreas Schultz wrote:
> > Hi Klaus,
> >
> > On Sunday 21 April 2002 16:59, Klaus Schmidinger wrote:
> > > The new version 1.0.1 of the Video Disk Recorder project
> > >
> > > - Improved thread locking in the ring buffer to avoid possible race
> > > conditions under heavy load (thanks to Werner Fink).
> >
> > Could you or Werner Fink explain what excatly those changes are supposed
> > to fix?
> > I was going over that code before and IMHO is there no race, with a
> > slight change could the code even work completly without locking. There
> > exists only a race between clear and get/put, but that is taken care of
> > by cPlayBuffer.
>
> IMHO the variables head and tail shouldn't be changed without hold
> Lock during the changes (ringbuffer.c cRingBufferLinear::Get() and
> cRingBufferLinear::Put()).  This may fix the problem seen by some

Theoreticly you're right, but Get() is only used by exactly one output thread 
and Put is only used by exactly one input thread, always. tail is only 
modified by Get() and head is only modified by Put(), the only piece that 
needs protection is therefor the space calculation at the beginning of Get() 
and Put().
Your change does not hurt, but it also does not changes anything, i would be 
surprised when it could fix the brocken recording problem.

> people (including me) with broken records from Pro7 mainly with AC3 5.1.
> Nevertheless even this isn't the reason it doesn't hurt.

Andreas



Home | Main Index | Thread Index