- Most actors are started from the deployment XML file, but there is other methods.
- This example show them all.
- |br| `examples/s4u/actor-create/s4u-actor-create.cpp <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/actor-create/s4u-actor-create.cpp>`_
+ Most actors are started from the deployment XML file, because this
+ is a :ref:`better scientific habbit <howto_science>`, but you can
+ also create them directly from your code.
+
+ .. tabs::
+
+ .. group-tab:: C++
+
+ You create actors either:
+
+ - Directly with :cpp:func:`simgrid::s4u::Actor::create`
+ - From XML with :cpp:func:`simgrid::s4u::Engine::register_actor` (if your actor is a class)
+ or :cpp:func:`simgrid::s4u::Engine::register_function` (if your actor is a function)
+ and then :cpp:func:`simgrid::s4u::Engine::load_deployment`
+
+ .. showfile:: examples/s4u/actor-create/s4u-actor-create.cpp
+ :language: cpp
+
+ .. group-tab:: Python
+
+ You create actors either:
+
+ - Directly with :py:func:`simgrid.Actor.create()`
+ - From XML with :py:func:`simgrid.Engine.register_actor()` and then :py:func:`simgrid.Engine.load_deployment()`
+
+ .. showfile:: examples/python/actor-create/actor-create.py
+
+ .. group-tab:: XML
+
+ The following file is used in both C++ and Python.
+
+ .. showfile:: examples/python/actor-create/actor-create_d.xml
+ :language: xml
+
+ - **React to the end of actors:** You can attach callbacks to the end of
+ actors. There is several ways of doing so, depending on whether you want to
+ attach your callback to a given actor and on how you define the end of a
+ given actor. User code probably want to react to the termination of an actor
+ while some plugins want to react to the destruction (memory collection) of
+ actors.
+
+ .. tabs::