ni.com checkout is currently experiencing issues.

Support teams are actively working on the resolution.

Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Queue size monitoring in AF

Hi Folks,

I was thinking about queue size and essentially keeping tabs on it. Suppose I have a supervising actor who asks and hopefully receives a heartbeat message from a worker actor. Is is possible for the actor to report its own queue size to the other actor? How would the worker actor get the queue size - ideally 3 values, one corresponding to each priority level? Is it possible for the supervisor to directly examine the worker's queue length?

Thanks,

Rik

0 Kudos
Message 1 of 4
(4,299 Views)

There is no access provided to that information -- an actor cannot view its own queue nor anyone else's queues. Getting the count of elements in the queue was one of the major sources of race conditions (people thinking it was safe to check for empty queue in that way). Because it was such a threat to code, that information was locked away to the best of my ability to do so.

Why do you need this? Is it just for debugging? The Monitor Actor system for debugging would allow your debugger to know how many sends have been done compared to how many receives, without you being able to inject that information into your code.

If you're really desperate to know this info in your own app, you can edit the AF VIs directly. But I don't recommend it.

0 Kudos
Message 2 of 4
(3,570 Views)

Could you please link to more info on the monitor actor system AQ? It sounds like it will meet my needs. Essentially I just want to be able to know if my worker actor can't keep up with incoming messages. It would certainly be useful for debugging, but I would put it in the general fabric of my app so that the condition is always checked against. Unless I'm mistaken, there's nothing really limiting the queue size naturally (I'm sure for good reason, because of the alternative of dropped messages) and so I would want to know if for some reason an actor wasn't able to handle the incoming rate.

0 Kudos
Message 3 of 4
(3,570 Views)

Monitored Actor is pretty cool, but it requires that you insert an actor type into your inheritance hierarchy.  That can be a problem in some circumstances.

If you are using LabVIEW 2015 and have access to Desktop Execution Trace Toolkit, you can get the same information without burdening your inheritance hierarchy.  (f you are in an earlier version and can't migrate, PM me.)

0 Kudos
Message 4 of 4
(3,570 Views)