Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Nested Actors taking time to stop

Solved!
Go to solution

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. 

0 Kudos
Message 1 of 8
(2,119 Views)

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.

0 Kudos
Message 2 of 8
(2,057 Views)

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....  

0 Kudos
Message 3 of 8
(2,051 Views)

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.    

0 Kudos
Message 4 of 8
(2,046 Views)
Solution
Accepted by topic author mka89

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.

Philip Bear
Certified LabVIEW Developer
0 Kudos
Message 5 of 8
(2,038 Views)

That solution definitely sounds like something pretty close to what I was trying to do. Thank you for that input!  

0 Kudos
Message 6 of 8
(2,033 Views)

What is an "SPI Map"?

0 Kudos
Message 7 of 8
(2,028 Views)

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.  

0 Kudos
Message 8 of 8
(2,019 Views)