Each Adaptive Application runs as an independent POSIX process with its own virtual address space. The Execution Manager (EM) launches each process via execve() using the parameters in the Application Manifest. Processes do not share BSS or data segments — spatial isolation is enforced by the MMU.
The ara::core::Initialize() call (required before any other ara:: API call) connects the process to the Execution Manager via an IPC channel, registers the process identity, and sets up the internal ara::com communication middleware. ara::core::Deinitialize() must be called before process exit to cleanly release all middleware resources.
#include <ara/core/initialization.h>
#include "my_service_skeleton.h"
int main() {
// Mandatory: connect to EM and initialise all FCs
if (auto res = ara::core::Initialize(); !res) {
return EXIT_FAILURE;
}
// Offer the service via ara::com skeleton
MyServiceSkeleton skeleton(
ara::core::InstanceSpecifier{"MyApp/MyService/Instance0"});
skeleton.OfferService();
// Application event loop
while (running) {
skeleton.MyEvent.Send(ReadSensor());
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
skeleton.StopOfferService();
ara::core::Deinitialize();
return EXIT_SUCCESS;
}
💡 Key Point
Unlike Classic where SchM_Act triggers a runnable, the Adaptive application owns its own thread management. You decide when to call Send(), GetNewSamples(), and when to block on a condition variable.