Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Is Time Delayed Message Blocking in RT?

Solved!
Go to solution

I have been observing a spike in CPU when there is a case of sending a time delayed message on a cRIO.  Is this a blocking function?

Thanks,.

Casey

Casey Lamers


Phoenix, LLC


casey.lamers@phoenixwi.com


CLA, LabVIEW Champion


Check Out the Software Engineering Processes, Architecture, and Design track at NIWeek. 2018 I guarantee you will learn things you can use daily! I will be presenting!

0 Kudos
Message 1 of 8
(5,211 Views)

Does "Time Delayed Send Message" still open a reference to a clone pool on each call?  Because that might cause a spike.

0 Kudos
Message 2 of 8
(3,997 Views)
Solution
Accepted by topic author CaseyLamers1

Aristos Queue informed me that the Time Delayed Message is blocking in RT as currently coded.

Casey Lamers


Phoenix, LLC


casey.lamers@phoenixwi.com


CLA, LabVIEW Champion


Check Out the Software Engineering Processes, Architecture, and Design track at NIWeek. 2018 I guarantee you will learn things you can use daily! I will be presenting!

0 Kudos
Message 3 of 8
(3,997 Views)

How does something "blocking" cause a CPU spike?

0 Kudos
Message 4 of 8
(3,997 Views)

Maybe the time delay code is a fast loop? By the way that would be strange ...

I am also interested in how can it be..

0 Kudos
Message 5 of 8
(3,997 Views)

It is my understanding that a blocking method pauses all other methods.  Upon release all methods that have been waiting will try to catch up.

I can say that if I increase the delay for sending the time delayed message that the corresponding peak gets higher until it reaches 100% and then it gets longer.

Casey

Casey Lamers


Phoenix, LLC


casey.lamers@phoenixwi.com


CLA, LabVIEW Champion


Check Out the Software Engineering Processes, Architecture, and Design track at NIWeek. 2018 I guarantee you will learn things you can use daily! I will be presenting!

0 Kudos
Message 6 of 8
(3,997 Views)

Worth noting here too that I recently removed some Time Delayed Message sending from my app, and saw pretty large performance benefits.  I noticed during a profiling run that the function takes quite a huge amount of crunching to do, _if_ you repeatedly send one-off messages to be sent in the future(very different from sending a recurring message).  It makes sense in hindsight since it creates a clone each time, but didn't notice for a long time.

But I saw times where it would take 100 ms on some cycles to actually perform the entire function.

So, were you using a recurring delayed message, or repeatedly using the send delayed message, one per call?

0 Kudos
Message 7 of 8
(3,997 Views)

I was using it in "Handle Error.vi" of a Linked Network Actor when a connection error would occur.  I would wait 1000 ms and then try to reconnect.  It works, but with a big spike in CPU which prompted the initial question.

Casey Lamers


Phoenix, LLC


casey.lamers@phoenixwi.com


CLA, LabVIEW Champion


Check Out the Software Engineering Processes, Architecture, and Design track at NIWeek. 2018 I guarantee you will learn things you can use daily! I will be presenting!

0 Kudos
Message 8 of 8
(3,997 Views)