Jump to content

Have to flush queue when recreate a same name queue?


Recommended Posts

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 frusty.gif .

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.