Running Several StateMachine in one program.

A forum for discussions about the C++ state machine framework yasmine.
In this forum you can ask questions about how something works, post your programming problems, file bug reports, request features, get information about licensing, ...
Ein Forum für Diskussionen über das C++ State Machine-Framework yasmine.
In diesem Forum kannst Du Fragen stellen, wenn Du wissen willst, wie etwas funktioniert, Du kannst Deine Programmierprobleme posten, Bugs melden, Features anfrangen, Fragen zur Lizenzierung stellen, ...
Milad
Posts: 4
Joined: 29 Aug 2018, 18:36

Running Several StateMachine in one program.

Postby Milad » 29 Aug 2018, 18:45

Hi,
First I have to appreciate your outstanding work. It is amazing.
I have a question is it possible to run several independent state machine in just one program? The state machines are run in different threads. Now I have run on state machine in one sub-thread and there is one in my main thread as well.
The problem is that when I run the main state machine the second one seems not working anymore.
Both of them are sync state machine.
Thank you in advance for your answer and time.

Wolfgang Petroschka
Posts: 5
Joined: 13 Jul 2016, 08:38

Re: Running Several StateMachine in one program.

Postby Wolfgang Petroschka » 04 Sep 2018, 10:07

Hi Milad,

firstly sorry for the delayed answer. I had overlooked the notification email.

"First I have to appreciate your outstanding work. It is amazing."
Thank you very much!

Yes, it is possible to run multiple state machines in one program. And it is a very common use case.
sync state machines just need to get their events in the corresponding threads. Are you firing the events in the corresponding threads (one time in the main thread, one time in the sub-thread)?
However, I recommend the use of async state machines whenever possible because they "automatically" run in their own threads without any further work on the side of the developer. I would only use sync state machines if absolutely necessary (e.g. on a system with low resources).

If you have further problems or if you want us to have a look at your current problem, please provide us with some minimal source code reproducing the problem. Then we'll have a look.

Best regards,
Wolfgang

Milad
Posts: 4
Joined: 29 Aug 2018, 18:36

Re: Running Several StateMachine in one program.

Postby Milad » 23 Oct 2018, 08:03

Hi,
Thank you very much for your answer.


Return to “yasmine”

Who is online

Users browsing this forum: No registered users and 0 guests