[mythtv] [BUG?] Endless waiting for thread...
Kevin Kuphal
kuphal at dls.net
Fri Mar 11 15:13:58 UTC 2005
Anduin Withers wrote:
>>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.
>>
>>
>
>Then you trade the possibility of five deadly locked calls for the very
>likely scenario of one.
>
>
I'm not sure I see how. If the ProcessRequestThreads are using tryLock
waiting for something to appear in the queue they are not deadlocked,
just looping. And then the only other lock is on the readSocket for
putting items into the queue. As you said, the problem isn't locking
per se but the behavior is such that the threadPool is starved so it
seems to me the best answer is to alleviate the threadPool as it exists
and put the onus on a command queue. It isn't feasable to use tryLock
when returning a thread to a pool, but it does work fine for a request
thread for pulling commands out of the queue.
Kevin
More information about the mythtv-dev
mailing list