Tracking whether a connection is alive

Joerg Barfurth joerg.barfurth at sun.com
Mon Jul 12 02:59:21 PDT 2004


Hi,

Owen Fraser-Green schrieb:

>>>What I'd suggest is that while a peer has a device locked HAL sends Ping
>>>messages to that service every few seconds until it's unlocked. One
>>>downside is that by requiring this I guess you make it harder to write
>>>clients because if the task you're doing isn't easily interruptable (is CD
>>>writing? I guess it must be ....) you need threading and such to respond
>>>to pings.
>>

>>OK, any reasonable CD writer application probably has a thread to update
>>the UI anyway, so this seems like an acceptable thing to do.
> 

> But this would only help to prove that the thread handling UI is alive
> and well but nothing much about the thread doing the actual job which
> owns the lock. What if that thread gets into an infinite loop or the
> library it calls locks up? If you then decide to make monitoring thread
> intelligent enough to detect these situations then it might as well have
> have just told HAL when the thread went AWOL instead of HAL polling it
> all the time.
> 

This suggests that it might be better to return to the other solution 
that was mentioned in this thread: Instead of HAL pinging all lock 
holders the lock holders have to renew their locks in regular intervals. 
This would properly be sent done the thread doing the actual work.

> I don't think anything can really detect locking up better than the
> user...
> 

But many users don't have a clue what to do when they find something 
hanging. And of of course there are many things going on that the user 
doesn't see directly - so has no way of recognizing as hanging.

Ciao, Jörg







More information about the dbus mailing list