Comments (8)
There also seems to be some kind of race condition happening, I can't get my second state to move to the third state however if I break at line
and wait a while and then break at after some time, I can see that the state change occurs.This setup has Mode = ExpectsReply.
from marte2.
That was a red herring, the state was actually moving to the error state instead. So possibly not a race condition - the scheduler we're using is the GAMBareScheduler
Looking through how this works:
- MessageGAM sends message to StateMachine to GOTOSTATE1 (or 2) and waits for Reply - must be an indirect Reply.
- StateMachine receives message and calls up application to move states in three messages. and waits for indirect replies from application.
- Application triggers the scheduler to run through the changes:
The odd behaviour is also that when it goes to error state as the file input for my test is end of file, it moves to state 3 then - not the error state instead.
from marte2.
It looks like this only executes once:
When I in fact have 4 states
from marte2.
Okay I'm going to spend today having a good look at this. I suggest for the first state issue, the application name used in the config be a parameter for the StateMachine object. Then when it starts up, it sends a message to the application and the application will have a messagefilter setup at startup to listen for this message, when it hears this message, it then sends back the name of the state that it is starting in. Then the statemachine will execute the section which adds the message filters for this. This does create a bit of a race condition so maybe once the statemachine has completed setup, it then sends back to the application to continue as it is ready to do so. @aneto0
from marte2.
It seems I've narrowed the issue down to the fact that the third message here:
Never actually returns. So something about having the RT App/Scheduler call to start the next state causes this to stall. Possibly it kills the thread?
from marte2.
Diving further, this is because This function call never returns:
This is because it calls this function when it is the third message:
My Scheduler is the GAMBareScheduler. This basically seems to then execute within this thread/stack in an infinite loop:
So the question is: How does the RealTimeApplication start the first state thread in the first place using prepare etc... and not have to wait, when it is happy to continue moving forward.
from marte2.
It seems this possibly happens again, when we look at our logs, this call:
Never then progress to print out:
I just reran my testing with GAMScheduler and didn't find this issue.... dratt. The whole reason we're using GAMBareScheduler is because of the MaxCycles has been exploited so we can use this for simulations and then running testing in a pipeline on Gitlab.
from marte2.
Focusing on the issue of the StateMachine assuming you start in the first state. I can see it gets initialised here:
https://github.com/sudilav/MARTe2/blob/162882ac4416431163bc8ce084ca9db9acf91223/Source/Core/BareMetal/L6App/Loader.cpp#L142
PrepareNextState never gets called for it as it isn't part of the application but a seperate entity.
The data field in the Loader function does know and contain the first state but this doesn't get passed onto the Initialise function so is an inaccessible variables to the StateMachine to possibly know what the first state is.
from marte2.
Related Issues (3)
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 marte2.