You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/Tutorials/Demos/Intra-Process-Communication.rst
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -363,8 +363,7 @@ Let's run it with the command:
363
363
Just like the last example, you can pause the rendering with the spacebar and continue by pressing the spacebar a second time.
364
364
You can stop the updating to inspect the pointers written to the screen.
365
365
366
-
As you can see in the example image above, both image windows show the same memory addresses for all three pointers.
367
-
This demonstrates that all nodes are sharing the same message instance through zero-copy intra-process communication.
366
+
As you can see in the example image above, both image windows show the same memory addresses for all three pointers.
368
367
To understand why this is happening consider the graph's topology:
369
368
370
369
.. code-block:: bash
@@ -378,7 +377,7 @@ For the link between the ``watermark_node`` and the two image view nodes the rel
378
377
Note that the image view nodes are not subscribed with ``unique_ptr`` callbacks.
379
378
Instead they are subscribed with ``const shared_ptr``\ s.
380
379
When the first intraprocess subscription is handled, the internally stored ``unique_ptr`` is promoted to a ``shared_ptr``.
381
-
The system then delivers the same ``shared_ptr`` to both callbacks, allowing each callback to receive shared ownership of the same message.
380
+
The system then delivers the same ``shared_ptr`` to both callbacks, allowing each callback to receive shared ownership of the same message.
382
381
This means all six addresses shown in the image windows will be identical, demonstrating efficient zero-copy memory sharing even in a one-to-many publisher-subscriber relationship.
0 commit comments