.. group-tab:: C
- .. autodoxymethod:: ::sg_mailbox_set_receiver(const char *alias)
+ .. autodoxymethod:: sg_mailbox_set_receiver(const char *alias)
.. _API_s4u_Resource:
- Directly with :py:func:`simgrid.Actor.create()`
- From XML with :py:func:`simgrid.Engine.register_actor()` and then :py:func:`simgrid.Engine.load_deployment()`
+ .. example-tab:: examples/c/actor-create/actor-create.c
+
+ You create actors either:
+
+ - Directly with :cpp:func:`sg_actor_create()` followed by :cpp:func:`sg_actor_start`.
+ - From XML with :cpp:func:`simgrid_register_function` and then :cpp:func:`simgrid_load_deployment`.
+
.. example-tab:: examples/python/actor-create/actor-create_d.xml
The following file is used in both C++ and Python.
.. example-tab:: examples/python/async-waitany/async-waitany.py
See also :py:func:`simgrid.Comm.wait_any()`.
+
+ .. example-tab:: examples/c/async-waitany/async-waitany.c
+
+ See also :cpp:func:`sg_comm_wait_any`.
.. _s4u_ex_execution:
* Even in this simple example, the pending comms do not terminate in the exact same order of creation.
*/
while (pending_comms_count != 0) {
- int changed_pos = sg_comm_wait_any_for(pending_comms, pending_comms_count, -1);
+ int changed_pos = sg_comm_wait_any(pending_comms, pending_comms_count);
memmove(pending_comms + changed_pos, pending_comms + changed_pos + 1,
sizeof(sg_comm_t) * (pending_comms_count - changed_pos - 1));
pending_comms_count--;
SG_BEGIN_DECL
XBT_PUBLIC int sg_comm_wait_any_for(sg_comm_t* comms, size_t count, double timeout);
+XBT_PUBLIC int sg_comm_wait_any(sg_comm_t* comms, size_t count);
SG_END_DECL
} // namespace s4u
} // namespace simgrid
/* **************************** Public C interface *************************** */
+int sg_comm_wait_any(sg_comm_t* comms, size_t count)
+{
+ return sg_comm_wait_any_for(comms, count, -1);
+}
int sg_comm_wait_any_for(sg_comm_t* comms, size_t count, double timeout)
{
std::vector<simgrid::s4u::CommPtr> s4u_comms;