ā03-01-2021 11:42 AM
I am new to Actor Framework and trying to convert an existing project to Actor Framework. In this project I need to launch about 15000 nested actors. Currently I am checking with launching about 7000 actors. I am able to launch these nested actors but when I stop the Top Actor it takes several minutes for the program to stop. I am assuming that the stop core running so many times is causing the delay but am not sure. I don't want it to take so much time to stop. Is there any suggestion to reduce this time. Also is launching so many actors a bad idea? Any insight on this is welcome.
Solved! Go to Solution.
ā03-02-2021 08:19 AM - edited ā03-02-2021 08:20 AM
I can't imagine any process (outside of database/web servers/file servers/etc) that needs 15,000 individual asynchronous processes. No wonder it takes so long!
What are you doing with these actors? I would bet there's a way to do it with just a single actor.
ā03-02-2021 09:24 AM
I'm afraid LabVIEW isn't designed for that high number of async-called processes. Tens and hundreds is the number more normally reached. Here is a past discussion, for interest: https://forums.ni.com/t5/Actor-Framework-Discussions/Actor-Framework-Inheritance-and-Execution-Syste....
ā03-02-2021 10:54 AM
The project has to work with a SPI Map of about 15000 bits and I want to do a particular set of actions when a specific bit changes (such as update all the user forms where this bit is present or change another bit when this bit is changed) . So in every bit's class object I want to store a list of actions to do as an array of functions and it should happen automatically when bit is changed. Previously I had these bits as class objects stored in a variant lookup and when I changed a bit I would look for the particular bit and manually run the functions run associated with the bit. I was wondering if that could be made with a user event and an event structure for each bit. So when a bit changes it automatically runs all the functions associated with it, and hence I wanted to see if I could use Actors to do that. I understand that is going to be tremendous overhead, so I am going back to what I was doing previously or maybe there is some other way to do what I want here.
ā03-02-2021 11:28 AM
I would probably dig into Dynamic Dispatch. Create a parent "action" object, with child action implementations where each child has an overridden "Do.vi" method that implements the function you want to run on the bit. These children can be bundled into an array of the parent type, if you call the parent "Do.vi" method in a loop LabVIEW will automatically run the child implementation instead! This would allow you to define a unique set of actions/order for each bit in your set. Depending on how your bits are being checked for changes you could also put that as the consumer side of a producer consumer structure. The producer side would check the bit objects for change and if they've changed pass them as a message to the consumer where your action array is run.
ā03-02-2021 12:19 PM
That solution definitely sounds like something pretty close to what I was trying to do. Thank you for that input!
ā03-02-2021 12:35 PM
What is an "SPI Map"?
ā03-02-2021 02:16 PM
The "SPI map" is a bitwise representation of the registers of all the addresses in an integrated circuit which can be accessed using SPI (Serial Peripheral Interface) based protocol . It might be a term used where I work and not used commonly. Sorry for the confusion, that was unnecessary information from me.