On Wed, 9 Jul 2003 10:33:13 -0400, "Isaac Richards ijr-at-po.cwru.edu
|mythtv/1.0-Allow|" <e6kbhbk35r0t at sneakemail.com> said:
> Every distinct database connection needs to protected against
> simultaneous
> access from different threads -- the transcode thread has its own
> connection,
> but that same connection was being used in that customEvent. So, it
> doesn't
> need to be protected outside of that file, but just inside, so the
> customEvent doesn't do something with that db connection while the
> transcode
> thread is.
Ahh, ok. I didn't quite grasp that before. Anyhow I've been banging on
the code all day, and haven't had any problems (of course the
probablility of seeing any race (never mind a deadlock) between the
customEvent and polling thread is pretty slim, but the mutex looks
fundamentally sound to me, though I did add a comment to watch for
deadlocks between the transqlock and dblock in the future (no deadlock is
possible today)). So you can enable the polling thread if you like.
Also included is a patch which prevents the polling thread from
destroying the cutlist unless the cutlist was actually processed. It
also keeps a backup of its queue in the db now, so if the backend dies
with lots of transcodings queued, they don't go bye-bye.
The patch also defines the transcoding states in programinfo.h. I don't
really know that this is the right place to put them, since they are
currently only used by mythbackend/transcoder.cpp and
mythtranscode/main.cpp. If you prefer, feel free to duplicate the define
in each of those files, and remove it from programinfo.h. I like having
them in a single place, so that they don't get out of sync, but I don't
really know the best place, since the defines are only used by the above
2 cpp files.
.Geoff
--
Geoffrey Hausheer
XXXXXXXXXXXXXXXXXXXXX
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transcode9a.patch
Type: application/unknown
Size: 6629 bytes
Desc: not available
Url : http://lists.snowman.net/pipermail/mythtv-dev/attachments/20030709/8b28c8e1/transcode9a.bin