Stateflow event will start a new process?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
When adding code on a transit between two nodes in a stateflow chart, one can mix statements with events such as a trigger to a block outside the chart.
For pure statements I know that they will be executed sequencially. If a trigger inserted between two statements, will the next statement wait for its turn until the trigged block finishing execution?
Or the event will start a new process/thread (for the trigged block) which will run concurrently with the stateflow chart?
Thank you for your time!
3 Comments
Walter Roberson
on 14 Oct 2011
Are you referring to Parallel States, such as discussed at http://www.mathworks.com/help/toolbox/stateflow/ug/bqfbt0o.html
or are you referring to using multiple cores and hyperthreading?
I am not finding much evidence that Stateflow is able to use multiple cores at all. The closest I have found so far is
http://blogs.mathworks.com/seth/2009/03/31/parallel-computing-with-simulink-model-reference-builds/ which indicates that if you have the Parallel Computing Toolbox, you can generate SimTargets over multiple cores (as of R2009a)
Fangjun Jiang
on 15 Oct 2011
This is a good question. I remember we had to find this out when someone made a C code S-function accessing shared memory data. The S-function is triggered by an event during a transition. To be honest, I don't remember the conclusion any more. What I can suggest is that you make an example to test it out. Simulink has debug capability so you can actually run simulation step by step. You can find out the execution order. I think that will be the most convincing evidence that you can rest on.
Charles Wang
on 17 Oct 2011
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!