10-21-2014 12:45 PM
Hi all.
This is a cross post from the Actor Framework section. It's not specifically AF related so I thought I'd post it here to get some more opinions.
I'm using the Extensible Session Framework to manage access to my application's config file. At the core of this framework is a queue. When I start up the app, I create a named queue. Each actor that launches after that needs to obtain a reference to that queue. Problem is, when I try to obtain the queue the second time it's instead creating a new queue with a new refnum. This of course breaks everything. The attached execution trace screenshots show the named queue being created twice.
Any idea what could be causing this behavior?
10-21-2014 01:23 PM
Are you sure you have created a new queue?
I know that if you obtain another queue, it creates a new refnum. But both refnums refer to the same named queue.
Read the detailed help on Release Queue and you'll see how the Force Destroy? input causes it to destroy the queue and kill all of the references to it.
10-21-2014 01:37 PM
They refer to the same named queue but a different refnum. The hex refnum at the end of the queue name is different, indicating a new queue was created. I also had a probe on the Created New? output of the second Obtain Queue and registered TRUE.
10-21-2014 02:14 PM
Are you sure the names were EXACTLY the same? End Of Lines, spaces, etc. like to sneak in there every once in awhile.
10-21-2014 02:23 PM
Yep they were exactly the same. Here's what was going on: The project is built with Actor Framework. I was obtaining the queue in the Read Config method of the root actor. I was calling that in the Launch App vi BEFORE the Launch Root Actor vi. Launch Root Actor launches the actor using VI server. Queues cannot be used to communicate across application boundaries, so when I tried to obtain the second queue, it correctly determined that the queue did not exist. They both show up in the execution trace because I was doing a trace on the entire project. I changed the Read Config method in my root actor to create a one time use config refnum that is closed at the end of the method, then moved the Obtain Queue to the Pre Launch Init method. This worked perfectly. Thanks everyone. Link to other post: https://decibel.ni.com/content/thread/25057?tstart=0