Why does MOTMOD create its own threads?

More
1 year 9 months ago #318823 by drose
Hi all,

This question is coming from me trying to better understand motmod. What about motmod makes so that this comp needs to create and manage its threads instead of having the "threads" module handle setting up threads and then loading motmod after?

So far I understand that threads need to be loaded in a particular order (fastest to slowest) and that motmod also ensures that the base and servo thread are integer multiples of each other. Besides this what other things does the motion planner need to guarantee about its threads to work properly?

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #319201 by andypugh
I have always assumed it was just a convenience thing, but have never really looked into it.
The following user(s) said Thank You: drose

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #319211 by Grotius
Motmod is a component like tpmod.
rtapi creates posix threads. Rtapi does not care about thread speeds. Each posix thread calls a list off components. Then rtapi calls a function order into the component itself with dlopen...

motmod does not create threads.
motmod is a trajectory planner coordinator and supervisor.

 
The following user(s) said Thank You: drose

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #319212 by andypugh
motmod does create threads, in the sense that "loadrt motmod ......" will create the base and servo threads with the given rates.

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #319215 by Grotius
If you read it like that you think its modmot loading threads. But reality is different.
rtapi creates the threads.

 
The following user(s) said Thank You: drose

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #319482 by drose
Ok, so it would be reasonable to assume that if I moved the rtapi call from motmod/tpmod to somewhere else I should not expect weird side effects since this is all done through the fairly standard RTAPI API.
One other question I have is, why is there a limit on the # of threads created and the order they are created in? Is this again a convenience/limitation made to simplify things or more of a deliberate design trade-off?

Please Log in or Create an account to join the conversation.

Time to create page: 0.216 seconds
Powered by Kunena Forum