[mythtv] [BUG?] Endless waiting for thread...
thor
mythtv at lamedomainname.com
Sat Mar 12 22:44:02 UTC 2005
>
> Well, we could switch to using QSocketDevice for the backend (like the
> frontend uses). It's basically just a portable wrapper around the socket
> code, instead of the whole event-loop-needing QSocket class. We'd be able
> to just do a select() on the fds that way, I think. Probably need to spawn
> off a subthread to do the main socket handling that way, though.
>
All the socket based plugins in mfd work this way. There's also a pipe that's
watched, so in a single select() you can wait for anything coming in on the
socket, anything going out to any clients, or a signal from any other thread
that the select()'ing thread should wake up (ie. any other thread can just
put a few bytes in the pipe, and the select() will return). Works well.
see
MFDServicePlugin::waitForSomethingToHappen()
in
http://cvs.mythtv.org/cgi-bin/viewcvs.cgi/mfd/mfdlib/mfd_plugin.cpp?rev=1.27&view=markup
- thor
More information about the mythtv-dev
mailing list