Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] [DSF] timeouts

At 04:01 PM 6/23/2010, James Blackburn wrote:
On 23 June 2010 14:53, Marc Khouzam <marc.khouzam@xxxxxxxxxxxx> wrote:
> However, some calls are done within a synchronous DSF
> Query, and executed in the UI-thread.  If any of those
> don't complete, we are in trouble.  The Query class
> provides with a get(long timeout, TimeUnit unit)
> which we should probably use in those cases

If I understand this correctly, the above is very scary. Presumably
this is the cause of deadlocks like bug 314447 & bug 263689 where the
UI is waiting on a Query that never returns.

Well, there's two issues here.

1. We shouldn't be asking the GUI thread to wait pending the completion of an asynchronous DSF call
2. We must not ask the GUI thread to wait indefinitely for anything

Converting the GUI-thread indefinite waits to timed waits is something we should do immediately. Then comes the question of being a good citizen. I can't imagine making any asynchronous DSF call with any confidence that it will complete within the 0.1 seconds. It might, but the caller certainly couldn't claim to be confident that it will. And of course, if we set a timeout on such calls, the value will for sure exceed 0.1 seconds--that's just too small a window to commit a DSF call to. So, we really need to see how many of these calls can be avoided.

Back to the top