From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Updates data between Actors

Solved!
Go to solution

I'm really newbie to AF and trying to make new achitecture using AF.

And I bumped into a problem which looks like picture below.

1.png

The Controller has the indicators which I want to update data and usually I send the data to Controller from Communication Actor.

However, in this case, I wonder if it is a good structure to update a lot of data.

Controller might have a plenty of messages and it may cause the loop works slower.

I'm sorry that my English and the diagram are weird. I would appreciate it if you reply.

Thanks

0 Kudos
Message 1 of 3
(3,751 Views)
Solution
Accepted by topic author Kraw

Hope I understood your question right....

Sending data within messages is usually not a real problem. But you have to make sure that the Actor Core.vi (I guess this is what you mean by loop) does not get blocked due to time consuming data processing.

If data processing gets too much, try to outsource it to a helper loop running in parallel to the Actor Core parent call.

Hope this helps

0 Kudos
Message 2 of 3
(2,990 Views)

Oil's answer is good.

I'm going to elaborate more... in the early days of AF, a lot of us in this forum really worried about this question. Now, we do not worry so much. The data passing is really lightweight -- the LV queues are generally just shifting data around between wires, not creating a bunch of copies -- and the complexities introduced by trying to do any other sort of data passing is so bad that we try to avoid it at all costs. Using the enqueuers exclusively to communicate data is generally worth the minimal overhead that the extra layer of sending causes.

Even for "a lot of data", use the message passing and let the Controller update its own indicators. If you get to the end of the project and you find that you have a performance bottleneck, then and only then should you consider doing any other strategy. The strong probability is that you will not have such a bottleneck.

Message 3 of 3
(2,990 Views)