HFSM StateForge - high cpu iowait and asynchronous processing

Irbis used Ask the Experts™
I have an application which implements a state machine based on StateForge (StateBuilderCpp) generator. A state machine is defined as asynchronous and uses boost in the generated code:

<settings asynchronous="true" library="boost">

Open in new window

Actions (implemented methods) are very fast but are called frequently - events are triggered with 10ms intervals. State machine uses boost ioservice.

I run the application on a single core atom processor. Generally that pc is strongly utilized by others applications and I have noticed that sometimes when a cpu has a high iowait a dozen or so events are queued. Is it coincidence ? How to explains such behaviour ?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fractional CTO
Distinguished Expert 2018
Wow... Polling state machines... I haven't used polling code since the early 1980s...

At this point, there are so many options for doing zero load, async programming, likely solution is to rewrite your code using async i/o.

This will optimize your state machine application code.

Whether this will be enough to unload your ATOM CPU is another matter.

You've tagged using Linux, so I'm guessing you can ssh into the machine + use normal performance analysis tools for problem determination.

You "explain this behavior" by testing + determining root cause of problem. Never guess.

If you've never done this type of analysis, especially if this is an embedded system, likely best for you to hire someone + have them track down the problem.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial