Thang Nguyen Posted February 2, 2010 Report Share Posted February 2, 2010 Hi, I have just run into a case which I don't quite understand. In my program I created multi thread. Each thread will have each own data queue base on the name of the thread (ex: client 0 queue, client 1 queue, ..). The programs let you be able to remove the last thread and recreate a new thread with the same name for example delete client 1 and recreate client 1. So the program will recreate a thread named client 1 with a data queue named "client 1 queue". When I remove a thread, I always release the data queue of that thread. The issue happens when I recreate the queue, I cannot enqueue, it will have time out, and the queue doesn't work. So I played around with it and finally I tried with flush queue; and it works. Is this a problem with LabVIEW queue? should I flush it before I release a queue or should LabVIEW handle this job? Somehow the memory for the queue is not release if I don't use flush queue. It's just a guess. Hope to receive your idea. Maybe I will not ask this question because long time ago I always flush queue before release it. This is kind of following what I had learned. Then when I posted a question about queue on Lavag, there was someone asked me why I had to do like that, just release the queue. Now this issue comes up . Best regards, Thang Nguyen Hi, I have to add some information, I tried to flush the queue before release the queue, but it doesn't work. It works when I flush the queue after recreating it. Still not understand why. Please give me your idea. Quote Link to comment
Cat Posted February 2, 2010 Report Share Posted February 2, 2010 Take a look at this thread: http://lavag.org/topic/10400-queue-memory-management/ Your application is a little different since you are releasing your queue afterwards, but hopefully this will help you figure out what will work for you. Cat Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.