From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), 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: 

Single Instance of an Actor/Only Launch if not running

Solved!
Go to solution

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.

0 Kudos
Message 11 of 12
(824 Views)

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.

0 Kudos
Message 12 of 12
(824 Views)