08-10-2015
05:31 PM
- last edited on
11-06-2024
12:05 PM
by
Content Cleaner
drjdpowell wrote:
That's not consistant with what "Not a Refum" means for other LabVIEW references. A dead Queue/Notifier/DVR/etc. is is "Not a Refnum" even if it is a non-zero number.
LV is bipolar on what "not a refnum" means. Not A Refnum is a specific value of zero.
There is also a primitive that checks whether a given value is "not a refnum", by implication it means "not a valid refnum".
Using the Not A Refnum primitive is generally a bad idea. I explicitly did not include that functionality in the Actor Framework, as noted in the documentation.
The Last Ack message is the correct way to know when an actor has shut down.
08-11-2015 06:25 AM
AristosQueue wrote:
Using the Not A Refnum primitive is generally a bad idea. I explicitly did not include that functionality in the Actor Framework, as noted in the documentation.
The Last Ack message is the correct way to know when an actor has shut down.
Yes, I see what you mean about possible race conditions and misuse.
I looked through my own framework for uses of my "Valid" method, which gives the functionality of "Not a valid refnum". It occures in two types of places:
-- probes and debug tools
-- "Async Actions", which are simple short-lived async processes that do one thing then forward a single message to a specified "address" before shutting down. They monitor that address, so they can terminate themselves early if the address becomes invalid (as then they have no reason to continue). Async Actions provide functionality like delayed message sending, asynchronous dialog boxes, gathering replies from multiple actors into one message, etc. They can't use a "Last Ack" system, as they are not the Caller of the actors they are monitoring.