<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Buechler, Mark R wrote:<br>
<blockquote
cite="midB0E6075E55C7D6119DDE0002A53F8BCE04E4E147@blmsrocopc07.bausch.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<title></title>
<meta content="MSHTML 6.00.2800.1400" name="GENERATOR">
<div align="left" dir="ltr"><span class="126043118-15072004"><font
color="#0000ff" face="Arial" size="2">The problem is you don't want it
cached and at the same time update every second - what would be the
point? You would only be as up to date as your cache which could be
several seconds off. Maybe a better way would be to on every channel
change pull in 2 (or more) hours of information and only check again
after 2 hours for updates. Then you could update at the times when the
schedule changes.</font></span></div>
<div><span class="126043118-15072004"></span> </div>
<div><span class="126043118-15072004"><font color="#0000ff"
face="Arial" size="2">- Mark.</font></span></div>
<div align="left" dir="ltr"><br>
</div>
<div class="OutlookMessageHeader" align="left" dir="ltr" lang="en-us">
<hr tabindex="-1"><font face="Tahoma" size="2"><b>From:</b> Tako
Schotanus [<a class="moz-txt-link-freetext" href="mailto:quintesse@palacio-cristal.com">mailto:quintesse@palacio-cristal.com</a>] <br>
<b>Sent:</b> Thursday, July 15, 2004 2:10 PM<br>
<b>To:</b> Development of mythtv<br>
<b>Subject:</b> Re: [mythtv] Watching Live TV & method
TV::GetChannelInfo getting called every second<br>
</font><br>
</div>
Isaac Richards wrote:
<blockquote cite="mid200407151309.47103.ijr@po.cwru.edu" type="cite">
<pre wrap="">On Thursday 15 July 2004 12:43 pm, Buechler, Mark R wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Admittedly, I'm working with a two day old copy of CVS but I've seen this
for a few weeks now. I see on my backend mysqld running at 45-55% CPU and
the frontend taking more CPU than it should as well. I tracked it down to a
SQL statement running every second getting channel information while
watching live TV.
I was wondering if anyone might know why
</pre>
</blockquote>
<pre wrap=""><!---->
LCD info updater. I didn't realize it was going every second, I'll bump it up
a lot, or actually, now that I look at this, I don't think it's thread safe
at all..
</pre>
</blockquote>
Sorry, had no idea that GetChannelInfo would hit the database so much.<br>
It did this every second so you could see program info changes while
watching live tv.<br>
<br>
So now I've got two questions because I really want this to work (and
I'm not the only one for sure).<br>
<br>
1. Is there a way to get this channel information without hitting the
database so much? (Is there a function that does local caching of the
results for eample?)<br>
<br>
2. Why isn't it thread-safe? I tried to model the LCD code as much as
possible on the OSD code thinking that if it was okay to update the OSD
it would probably be okay to update the LCD as well. But if you can
tell me where/how it can go wrong I'll fix it (or at least try to).<br>
<br>
Cheers,<br>
-Tako<br>
</blockquote>
When I say caching I don't mean the method should just mindlessly
return what it returned before, the method takes a date/time argument
so it could easily check that the requested information is not in the
cache of previously requested programs and request that info from the
backend server. A timeout in the cache could make sure that once every
so many hours the info would be flushed.<br>
<br>
But anyway, such a method doesn't exist and it will be much more work
to make such a caching mechanism than just switching the timer to 1
minute like Isaac suggested, so I guess I'll just do that :-)<br>
<br>
Cheers,<br>
-Tako<br>
<br>
</body>
</html>