Shared Memory Object Creation Strategy - Quo vadis ProcessManager?
#1864
mossmaurice
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary and problem description
In iceoryx applications use a different means of communication to register with the central daemon RouDi and hereby gain access to the shared memory segments. Either a POSIX message queue or a UNIX domain socket can be used.
Problems
ProcessManageruses strings to iterate over its process listProcess,Node,Publisher,Subscriber,ConditionVariablecan be created independent from each otherProcess::~Process()is called e.g.Nodeis not cleaned upCREATE_PUBLISHER)m_ToBeDestroyed = trueIn scope
ProcessManagerandPortManagerhave?iox::vector,iox::list?Out of scope
Terminology
PoshRuntimeEntitiyFactoryProcess,Node,Publisher, etc.IpcMessageTypeProcessManagerPortManagerPortManagerPortPool, does discoveryPortPoolDesign
iox::runtime::PoshRuntime::initRuntime("foo")shall create both aProcessandNode. All other entitieslive inside the
Node. If wanted, otherNodescan be created by callingcreateNode(). The following objectdiagram depicts an example.
UML diagram
If a
Processis destructed it shall automatically cause the deletion of all of its contained entities.Merge
PortManagerandProcessManagertogether into aEntityFactory. Another name could beUserObjectFactory.PortPoolshall stay as the interface to the shared memory data structures.Alternative 1
PoshRuntimeonly registers via IPC channel and uses a factory in shared memory to create the entities.The
IpcMessageTypewould look like:On registration a pointer to a
EntityFactorywould be provided and thePoshRuntimewould be able use it independently. This class would need to be thread-safe.Alternative 2
PoshRuntimedoes registration and creation of entities via IPC channel and factory is soley accessed by RouDi. The IPC channel would transfer raw pointers which would be wrapped inunique_ptr's by thePoshRuntime. In case of a graceful shutdown of an application the deleter function of thecxx::unique_ptrwould cleanup the resources e.g.Process.Considerations
wait()calls on two data structures (IPC channel, factory queue)EntityFactoryin shared memory by mistakeEntityFactorycan lead to higher complexity (locking or lock-free mechanism required)Open issues
All reactions