[mythtv] I'm working on UNICABLE improvment - help needed

Torbjörn Jansson torbjorn.jansson at mbox200.swipnet.se
Mon Aug 26 20:21:28 UTC 2013

> Jean-Yves,
> Thx You found time to respond.
> Indeed it should be initialized out of class level to allocate memory.
> Now compiles OK :-)
> But I'm surprised by results: it looks like variable is still not
> global
> across all dvbchannel instances but seems to be still instance
> specific.
> Some background:
> What I want to achieve is an semi-serialization on SCR(unicable) bus.
> Currently all dvbchannels objects are living in parallel with full
> isolation with relation: phy tuner<->dvbchannel object(instance).
> This is OK as phy tuners are physically separate.
> Unicable however has shared SCR bus and in proper design multiple
> tuners
> access to this bus should be coordinated.
> During last year I solved this by predictably delaying event processing
> in recorders - so I can easy setup system with starting 16 concurrent
> recordings and it works without issues.
> Price in this solution is delayed start of recordings. For 20 tuners
> system delay might be even 10s.
> Now I want to change solution to little more sophisticated.
> Going back to our topic: using static variable gives me following
> situation:
> time t1: tuner1 dvbchannel instance sets var=t1
> time t2: tuner2 dvbchannel instance reads var and var=t2, not t1
> So it looks like I'm still missing something here....

If your variable is accessed by multiple threads don't forget about thread
synchronization and do proper locking.

More information about the mythtv-dev mailing list