[prev in list] [next in list] [prev in thread] [next in thread]
List: mythtv-commits
Subject: [mythtv-commits] Ticket #5591: Fix ThreadedFileWriter potential
From: "MythTV" <mythtv () cvs ! mythtv ! org>
Date: 2008-07-31 4:36:33
Message-ID: 050.6e7a1e81db5bb56bea56a73c9fd53791 () cvs ! mythtv ! org
[Download RAW message or body]
#5591: Fix ThreadedFileWriter potential deadlock
------------------------------+---------------------------------------------
Reporter: jppoet@gmail.com | Owner: ijr
Type: patch | Status: new
Priority: major | Milestone: unknown
Component: mythtv | Version: unknown
Severity: medium | Mlocked: 0
------------------------------+---------------------------------------------
If ThreadedFileWriter::Write() is fed more data than can fit into it's
internal buffer, it will deadlock. ThreadedFileWriter::Write() will block
waiting for BufFree() to be greater than the data to be written, but that
will never happen.
The attached patch creates a loop in ThreadedFileWriter::Write() to
process the fed data into the internal buffer as space becomes available.
This can cause ThreadedFileWriter::Write() to take longer to return, but
as long as the recorder has a big enough buffer (or uses
DeviceReadBuffer), then it should not be a problem.
The other option is for ThreadedFileWriter::Write() to only process as
much as it can in one pass, then return that amount to the calling
function. However, this causes a problem with keyframes. Since
"recorders" need to note the position in the file where keyrframes are
written, if they don't actually get written, then the position would be
wrong.
I found this problem with recording from the HD-PVR. I was experiencing
deadlocks in about 1:10 recordings.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/5591>
MythTV <http://www.mythtv.org/>
MythTV
_______________________________________________
mythtv-commits mailing list
mythtv-commits@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic