LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Releasing Queue in Producer Consumer model



@GReaper wrote:
The logic is, if the enqueue fails inside the producer loops it exits on error.  The code then assumes that the first dequeue in the consumer will also fail and provide an error out to end the consumer loop.  Does anyone know if this would ever not be the case?  Further, with the timeout wired would a dequeue return error or no error when trying to dequeue on a busted queue...  



If a Dequeue node is waiting when the queue is released elsewhere it will stop waiting and return error code 1122. If a queue is released and then the data flow comes to a Dequeue node, it will immediately return with error code 1. I can't think of any other possible scenarios.

One thing to watch out for is generating non-queue errors in your producer loop. That error will cause the producer loop to stop, but the Stop action will not get queued, and the consumer loop will keep waiting.

0 Kudos
Message 21 of 25
(1,309 Views)

Hello all,

 

I am still in the learning phase for "producer-consumer" type architectures. Actually I am considering State machines and producer/consumer loops. I have designed my application, for both the types of implementation, and now I need to decide which is the better way to implement.

 

Looking at this thread's discussion, I feel there are many issues in the producer/consumer loops. Is it an old way?

 

I mean, is the Standard State machine (template provided in the labview 8 or later) a better way to do things? Thought to ask in this thread since there is plenty of discussion here and a high concentration of "veterans" 🙂

 

Looking forward to hear, till I read some more stuff, as I need to do the coding, tonight, so have to take the decision now. As I said, I have made designs of both the models, for my application, to understand the flow.

 

Thanks ahead.

Vaibhav
0 Kudos
Message 22 of 25
(1,114 Views)

You are posting on an 2 year old thread. It is better to start a new one on your own.

 

Also, give us more details about what you want to do, as SM and PC are different concepts and an architectural choice is severe.

 

Felix

0 Kudos
Message 23 of 25
(1,110 Views)

Hi Felix,

 

Thanks for the interest.

 

Well, I have already started a thread for a different issue, which turned into this discussion about Producer consumer model.

Please take a look at http://forums.ni.com/ni/board/message?board.id=170&thread.id=403219

 

 

Vaibhav
0 Kudos
Message 24 of 25
(1,098 Views)

Again,

from this thread, I had some ideas about my application, and as Felix suggested, I have started a new discussion thread for my issue, at http://forums.ni.com/ni/board/message?board.id=170&thread.id=435798.

 

I would appreciate a lot if you could give some inputs to my brainstorming there. I am still trying to figure out PC and SSM complications, and the implementation deadline is almost on the neck.

 

Thanks ahead!

Vaibhav
0 Kudos
Message 25 of 25
(1,089 Views)