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
ProcessManager
uses strings to iterate over its process listProcess
,Node
,Publisher
,Subscriber
,ConditionVariable
can be created independent from each otherProcess::~Process()
is called e.g.Node
is not cleaned upCREATE_PUBLISHER
)m_ToBeDestroyed = true
In scope
ProcessManager
andPortManager
have?iox::vector
,iox::list
?Out of scope
Terminology
PoshRuntime
EntitiyFactory
Process
,Node
,Publisher
, etc.IpcMessageType
ProcessManager
PortManager
PortManager
PortPool
, does discoveryPortPool
Design
iox::runtime::PoshRuntime::initRuntime("foo")
shall create both aProcess
andNode
. All other entitieslive inside the
Node
. If wanted, otherNodes
can be created by callingcreateNode()
. The following objectdiagram depicts an example.
UML diagram
If a
Process
is destructed it shall automatically cause the deletion of all of its contained entities.Merge
PortManager
andProcessManager
together into aEntityFactory
. Another name could beUserObjectFactory
.PortPool
shall stay as the interface to the shared memory data structures.Alternative 1
PoshRuntime
only registers via IPC channel and uses a factory in shared memory to create the entities.The
IpcMessageType
would look like:On registration a pointer to a
EntityFactory
would be provided and thePoshRuntime
would be able use it independently. This class would need to be thread-safe.Alternative 2
PoshRuntime
does 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_ptr
would cleanup the resources e.g.Process
.Considerations
wait()
calls on two data structures (IPC channel, factory queue)EntityFactory
in shared memory by mistakeEntityFactory
can lead to higher complexity (locking or lock-free mechanism required)Open issues
Beta Was this translation helpful? Give feedback.
All reactions