Comments (3)
I cannot reproduce this issue with 2.9 and the gnulinux target.
With 58cb4bb it should not be possible to destroy an Activity
instance before the underlying thread is terminated. Before 2.9 the thread function was implemented in the RTT::os::Thread
class and it was only the ~Thread
destructor that joined after the Activity subclass has already been destroyed.
I see that there might be issues if setActivity()
would be called from the thread to be destroyed itself. Not sure if this is properly caught. But that does not seem to be the case in your example. Which thread executes the stop, configure, start operations? The TaskBrowser? Or a script running in the scripting service of exactly the component in question?
If there is no need to recreate the activity because only the periodicity changed, prefer setPeriod()
instead, which works even while the activity is running.
from rtt.
I found task.stop(); task.configure(); task.start(); sequence is called in client thread as OwnThread operation. It works fine when ClientThread used.
Is it acceptable to change activity during configureHook? I tried to apply priority and scheduler from properties/configuration not available at construction time.
from rtt.
Is it acceptable to change activity during configureHook? I tried to apply priority and scheduler from properties/configuration not available at construction time.
In general it is okay to set the component's activity in the configureHook(), but only if it is called from an external thread, not from the thread running the component itself (like in an OwnThread operation). Usually this external thread is the main thread and configure()
is called during deployment.
You can modify all relevant properties of an existing activity in configureHook(), while the thread is running without having to destroy the activity:
RTT::TaskContext *tc = this;
tc->setPeriod(new_period);
RTT::os::ThreadInterface *thread = tc->getActivity()->thread();
if (thread) {
thread->setScheduler(sched_type);
thread->setPriority(priority);
}
Note that not every activity has its own thread and a thread might be reused by multiple activities for certain activity types. At the moment getActivity()->thread()
always returns the main thread in case there is no thread associated to the activity, but I am going to change that for 2.9. For the standard Activity
there are no issues and the code snippet above should just do what you would expect.
from rtt.
Related Issues (20)
- no boost / RTTv3 HOT 1
- clarification on copyright HOT 3
- 2.9.1 ros debian package fails to install HOT 5
- Massive deadlocking when disconnecting connections in parallel HOT 2
- Portable install space HOT 10
- Omniorbpy
- rtt does not support const array ?
- orocos with imcompatiable gcc version (7.4) HOT 1
- cleanupHook called twice after in runtime -> exception -> cleanup
- sample given to setDataSample seem to sometimes "leak" to the other side HOT 3
- catkin build err HOT 2
- PluginLoader::loadTypekits throws boost::filesystem_error for "File name too long" with long path_list
- Problems installing OROCOS under Linux-RTAI/Xenomai HOT 4
- Value parse problem with user defined data in a property bag
- Windows build broken
- Could not allocate configuration semaphore 'sem' for ***,Throwing std::bad_alloc. HOT 1
- Orocos on raspberrypi 3b+ HOT 4
- How to properly configure services
- Communication between OROCOS components via Ethernet network HOT 3
- Deadlock when the input event port is disconnected from the output when the connection is active
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtt.