Mailing List archive

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

[vdr] Re: Video Disk Recorder version 1.0.1



Andreas Schultz <aschultz@cs.uni-magdeburg.de> wrote:

> > 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.

i just studied the source and i think you are right. to put a lock on
places where it is not needed, isn't that good IMHO. it suggestes that
there IS a race condition to the reader. at least there should be a
comment, that this should be removed, if it proves to be a waste of cpu
cycles. ;-)

best regards ...
clemens



Home | Main Index | Thread Index