Blocking behavior on synchronous proxy method when called from synchronous adaptor method? #241
-
Hi everybody, I've got a, probably more academic, question:
Is the behavior well-defined and will it work if: Or will/could this lead to a behavior where the connection will only service I've tried to write some example code for this, as this is something I've stumbled upon in one of my applications, which leads to the application being stalled. However, with the example code I've got somewhat erratic behavior, from working fine to long delays in Proxy method returns, though no real deadlocks. Am I missing something? Have I not grasped the concept of how sdbus works with connections during synchronous method calls? Thanks for any insights |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi. This use case is a valid one and yes it shall work as you logically expect. Synchronously calling Exactly such a use case is shown to work in sdbus-c++ stress tests: https://github.com/Kistler-Group/sdbus-cpp/blob/master/tests/stresstests/sdbus-c%2B%2B-stress-tests.cpp#L169 Hope this helps. |
Beta Was this translation helpful? Give feedback.
Hi. This use case is a valid one and yes it shall work as you logically expect. Synchronously calling
M2
onP
while servicing theM1
call simply blocks theA
(andP
, too) from processing further incoming D-Bus messages. These are being enqueued, waiting until theM2
call -- and, subsequently,M1
call -- has finished. And, naturally,M1
won't finish untilM2
has finished.M2
is a blocking call (given that I understand your situation correctly), thus blocks theM1
andM1
routing can only continue afterM2
has finished.Exactly such a use case is shown to work in sdbus-c++ stress tests: https://github.com/Kistler-Group/sdbus-cpp/blob/master/tests/stresstests/sdbus-c%2B%2B-stress-tests.cpp#L169