component_connector concurrency_mode
API Reference Manual  /  5 Model-to-Simulator Interfaces  / 

concurrency_group

Description
The concurrency_group interface is used to ensure that groups of objects are placed in the same thread domain.

The serialized_memory_group method returns a list with objects that should be placed in the same thread domain when the models run in Sim_Concurrency_Mode_Serialized_Memory.

The execution_group method returns a list with objects that should always be placed in the same thread domain.

Both methods take a group_index argument, allowing multiple lists to be returned. The index argument is 0-based, and a nil attribute for the first unsupported index. Note that returned lists do not necessarily contain the object implementing the interface; the interface can be used to group other objects.

When Simics forms the thread domain groups, all objects implementing the concurrency_group are queried, and the constraints are combined. For instance, the groups [A, B] and [A, C] are combined into the group [A, B, C]. That is, the objects A, B and C will be put in the same thread domain.

Refer to the threading chapter in the API Reference Manual for more details.

SIM_INTERFACE(concurrency_group) {
        attr_value_t (*serialized_memory_group)(conf_object_t *NOTNULL obj,
                                                unsigned group_index);
        attr_value_t (*execution_group)(conf_object_t *NOTNULL obj,
                                        unsigned group_index);
};
#define CONCURRENCY_GROUP_INTERFACE "concurrency_group"

Execution Context
Global Context for all methods.

component_connector concurrency_mode