-
Notifications
You must be signed in to change notification settings - Fork 82
Description
The patch cb4a376, which is part of PR #91, revealed a principal problem of the current implementation of SlaveActivity
and was therefore reverted in d04b1e9.
-
It is not clear to me what is the difference between a
SlaveActivity
which has a master activity and one which does not. According to documentation in SlaveActivity.hpp:* Any activity object can be a master of a SlaveActivity, * including itself. A master needs to keep track of its slave * itself. There is no standard mechanism in RTT in which masters * execute slaves. You need to code this yourself in your master * activity by calling execute() on each Slave.
So the member variable
mperiod
should be completely unused in casemmaster
is set. This is what motivated the "bugfix" in cb4a376.What does "including itself" mean in this context? I think the current implementation does not allow this and if it would, there were indefinite recursions. What was probably meant here is that a SlaveActivity can be the master of another SlaveActivity.
-
There is no automatic mechanism that keeps track of slave instances of an activity and that would notify them if their master is destroyed. As a consequence, it is the full responsibility of the user not only to execute the slaves, but also to make sure that the component which owns the master activity is not destroyed before the last slave, that still has a pointer. Otherwise calls to some member functions of the slave activity cause segfaults. Without cb4a376 the
mmaster
pointer was not accessed during the destruction of the slave, but checking the internalmperiod
member only is not consistent with the previous item. -
Unlike Activity, stopping the SlaveActivity asynchronously (e.g. from the main thread during cleanup) does not wait for the successful completion of the cycle, even if
breakLoop()
returned true.
I wonder whether there is a way to completely avoid that the slave activity has to know whether it is executed periodically or not. Actually there is no guarantee that the master executes all slaves periodically anyway, even if the master itself has a periodic activity.