Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SlaveActivity without master ExecutionEngine (pull request) #60

Merged
merged 3 commits into from
Oct 14, 2014
Merged

Conversation

meyerj
Copy link
Member

@meyerj meyerj commented Sep 1, 2014

Pull request for #59.

This reverts commit ed1d5f3.
…e if set

The master ExecutionEngine is set automatically if the engine runs in a SlaveActivity whose master activity also runs an ExecutionEngine.

Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>
psoetens pushed a commit that referenced this pull request Oct 14, 2014
SlaveActivity without master ExecutionEngine (pull request)

Functionally, the old behavior remains, but we delegate the responsibility from SlaveActivity to ExecutionEngine. Please yell if this breaks your case, but we believe it doesn't. The fatal error in the slave's trigger() function really needed to go since a slave without a master is quite valid.
@psoetens psoetens merged commit 9445321 into master Oct 14, 2014
@meyerj meyerj deleted the fix-59 branch October 31, 2014 20:17
@meyerj meyerj mentioned this pull request Apr 15, 2019
meyerj added a commit that referenced this pull request May 8, 2019
The patch reverts most of the previous patches applied to fix the issue that `OwnThread` operations provided by components running in a SlaveActivity have only been executed when the slave was updated, but never asynchronously like for normal activities. This caused dead-locks in certain situations when calling operations of slaves that are never updated before the call returns. The history of the reverted patches started with #35, with follow-ups in https://github.com/orocos-toolchain/rtt/issue/59, #60 and #71.

The `slave_test` added in one of the original PRs was not reverted and still succeeds with the new patch.

The new solution to the original problem is much less intrusive: Instead of forwarding the operations calls itself and making the ExecutionEngine aware of the existence of masters and slaves, the SlaveActivity that gets triggered (e.g. as a consequence of an operation call) enqueues a message in the master's ExecutionEngine that processes the triggers in the slave's ExecutionEngine `work(Trigger)` callback, which then processes all the pending messages (and port callbacks) of the slave. This also works across multiple levels of master/slave relations. The difference to the previous patch is the pending messages are still enqueued in the engine of the actual runner and explicit calls to `Slave.update()` from the master thread will also process the pending operations of the slave - but not of the master.

Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>
meyerj added a commit that referenced this pull request May 8, 2019
The patch reverts most of the previous patches applied to fix the issue that `OwnThread` operations provided by components running in a SlaveActivity have only been executed when the slave was updated, but never asynchronously like for normal activities. This caused dead-locks in certain situations when calling operations of slaves that are never updated before the call returns. The history of the reverted patches started with #35, with follow-ups in https://github.com/orocos-toolchain/rtt/issue/59, #60 and #71.

The `slave_test` added in one of the original PRs was not reverted and still succeeds with the new patch.

The new solution to the original problem is much less intrusive: Instead of forwarding the operations calls itself and making the ExecutionEngine aware of the existence of masters and slaves, the SlaveActivity that gets triggered (e.g. as a consequence of an operation call) enqueues a message in the master's ExecutionEngine that processes the triggers in the slave's ExecutionEngine `work(Trigger)` callback, which then processes all the pending messages (and port callbacks) of the slave. This also works across multiple levels of master/slave relations. The difference to the previous patch is the pending messages are still enqueued in the engine of the actual runner and explicit calls to `Slave.update()` from the master thread will also process the pending operations of the slave - but not of the master.

Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants