[mythtv] [BUG?] Endless waiting for thread...

Kevin Kuphal kuphal at dls.net
Fri Mar 11 01:10:49 UTC 2005


Anduin Withers wrote:

>>from ever getting a lock in order to replenish the queue?  When I saw
>>this error, the loop was executing very quickly:
>>
>>2005-03-07 22:21:32.326 waiting for a thread..
>>2005-03-07 22:21:32.346 waiting for a thread..
>>    
>>
>
>50 microseconds isn't very long which means, yes, pretty fast to print
>failures.
>
>You could try increasing the timeout but that isn't the problem. I'm
>attaching a tiny piece of code that will generate the error immediately (you
>need to run it pool size + 1 (currently 6) times within the timeout (5
>seconds)).
>
>This locks all available pool threads in a readBlock, there is no escape as
>the main event loop isn't called from the pool check (so even when the
>socket disconnects the signal won't have a chance to trigger).
>  
>
Well, with that being a possible case, would it make more sense to have 
a vector or queue of QString commands with locks around it during 
insertion and removal and then have the ProcessRequestThread pop 
commands off the vector.  That way the threads would remain locked until 
a command was received and pushed onto the vector by the readSocket 
function.  This way, no threads are ever lost, each thread blocks until 
a command is received, and we avoid the issue as it exists which 
seemingly prevents threads from pushing back onto the vector due to the 
lock checking.

Kevin


More information about the mythtv-dev mailing list