Tracking whether a connection is alive
david at fubar.dk
Sun Jul 11 15:54:16 PDT 2004
On Sun, 2004-07-11 at 23:46 +0100, Mike Hearn wrote:
> On Mon, 12 Jul 2004 00:20:38 +0200, David Zeuthen wrote:
> > What if an application locks up? I've tried that with K3B actually. I
> > guess what I'm asking for is that the system message bus pings all
> > connections regularly, like, say every five seconds or so.
> We definitely don't want that, it would slaughter performance by keeping
> parts of all programs connected to the bus paged in (stack, code pages,
Right. That's a very good point.
> You can already send org.freedesktop.Peer.Ping if locking up is a problem
> you wish to solve. Remember: In the case of an application has that GUI
> locking up, the user will eventually try and close it when they realise
> it's not responding at which point the WM will ping it and then force quit
> 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.
> Still it is probably the best course of action. Ping while a lock is held,
> don't ping while it's not.
Yeah, sounds like a plan.
More information about the dbus