Integration / D Bus Interview Questions
When should you use asynchronous D-Bus calls instead of synchronous?
A synchronous D-Bus call blocks the calling thread until a reply arrives, which is simple to write but dangerous anywhere responsiveness matters, most notably a GUI application's main thread, where blocking for even a second or two makes the whole interface freeze.
Asynchronous calls register a callback or return a future/promise-like object immediately, letting the caller continue processing other events, such as redrawing the UI or handling other messages, while the reply is delivered later when it actually arrives. This is the right choice whenever the call is made from a thread that also needs to stay responsive to other work, or when the destination service's response time isn't predictable.
Synchronous calls remain reasonable for short-lived scripts, command-line tools, or background worker threads where nothing else needs to happen while waiting, and where the simplicity of linear, blocking code outweighs the responsiveness concern.
More Related questions...