Re: [Discuss-gnuradio] Message Queue Thread Safety
On Tue, Feb 21, 2012 at 10:48 AM, Ryan Pape wrote: > > > On Mon, Feb 20, 2012 at 10:28 AM, Tom Rondeau wrote: > >> On Sun, Feb 19, 2012 at 6:29 PM, Ryan Pape wrote: >> >>> I have an application with some nasty race conditions I am trying to >>> pin-point. >>> >>> The application starts with a 256 channel filterbank. Approx 45 outputs >>> are connected to files, a handful to other blocks ending with a custom >>> block that puts messages in a GR message queue. >>> >>> >>> Occasionally, and randomly, one of the chains with my custom block >>> appears to stall for an extended time and puts no messages into the queue. >>> It appears it may restart at a random later time, and in every case I have >>> observed restarting the application fixes the problem immediately. At the >>> same time, another chain continues to send messages as I would expect. >>> >>> Is having two or more producers and one consumer on one GR message queue >>> across multiple threads a bad idea? I'm not employing any additional >>> locking on the queue, due to wishful thinking and ignorance. I could move >>> to a one consumer for each producer model and it would not significantly >>> change my application. >>> >>> Ryan >>> >> >> Ryan, >> So the custom sinks are doing an insert_tail onto the msg_queue and the >> other thread is doing a delete_head() to get the messages out? >> >> Are they all going into the same queue, or does each sink have it's own >> queue to send messages to? >> >> The insert_tail and delete_head both lock a mutex when called, so they >> are (or should be) thread safe. I'm trying to get a clearer picture of your >> setup to see what else could be happening. >> >> >> > Tom, thank you for the reply. > > You are correct with insert_tail from custom sink (2-5 in the application, > 1-10msgs/second each at peak) into ONE queue. A separate thread > continuously looping and delete_head() > Ryan, There should be nothing inherently wrong with this approach. Is there any other way to monitor the producer blocks to make sure they are actually getting data to send to the queue? Some output to stdout when they are active in any way? Tom ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Message Queue Thread Safety
On Mon, Feb 20, 2012 at 10:28 AM, Tom Rondeau wrote: > On Sun, Feb 19, 2012 at 6:29 PM, Ryan Pape wrote: > >> I have an application with some nasty race conditions I am trying to >> pin-point. >> >> The application starts with a 256 channel filterbank. Approx 45 outputs >> are connected to files, a handful to other blocks ending with a custom >> block that puts messages in a GR message queue. >> >> >> Occasionally, and randomly, one of the chains with my custom block >> appears to stall for an extended time and puts no messages into the queue. >> It appears it may restart at a random later time, and in every case I have >> observed restarting the application fixes the problem immediately. At the >> same time, another chain continues to send messages as I would expect. >> >> Is having two or more producers and one consumer on one GR message queue >> across multiple threads a bad idea? I'm not employing any additional >> locking on the queue, due to wishful thinking and ignorance. I could move >> to a one consumer for each producer model and it would not significantly >> change my application. >> >> Ryan >> > > Ryan, > So the custom sinks are doing an insert_tail onto the msg_queue and the > other thread is doing a delete_head() to get the messages out? > > Are they all going into the same queue, or does each sink have it's own > queue to send messages to? > > The insert_tail and delete_head both lock a mutex when called, so they are > (or should be) thread safe. I'm trying to get a clearer picture of your > setup to see what else could be happening. > > > Tom, thank you for the reply. You are correct with insert_tail from custom sink (2-5 in the application, 1-10msgs/second each at peak) into ONE queue. A separate thread continuously looping and delete_head() ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] Message Queue Thread Safety
On Sun, Feb 19, 2012 at 6:29 PM, Ryan Pape wrote: > I have an application with some nasty race conditions I am trying to > pin-point. > > The application starts with a 256 channel filterbank. Approx 45 outputs > are connected to files, a handful to other blocks ending with a custom > block that puts messages in a GR message queue. > > The application has a separate thread that is constantly de-queueing items > produced by my custom blocks. > > Occasionally, and randomly, one of the chains with my custom block appears > to stall for an extended time and puts no messages into the queue. It > appears it may restart at a random later time, and in every case I have > observed restarting the application fixes the problem immediately. At the > same time, another chain continues to send messages as I would expect. > > Is having two or more producers and one consumer on one GR message queue > across multiple threads a bad idea? I'm not employing any additional > locking on the queue, due to wishful thinking and ignorance. I could move > to a one consumer for each producer model and it would not significantly > change my application. > > Ryan > Ryan, So the custom sinks are doing an insert_tail onto the msg_queue and the other thread is doing a delete_head() to get the messages out? Are they all going into the same queue, or does each sink have it's own queue to send messages to? The insert_tail and delete_head both lock a mutex when called, so they are (or should be) thread safe. I'm trying to get a clearer picture of your setup to see what else could be happening. Tom > > ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] Message Queue Thread Safety
I have an application with some nasty race conditions I am trying to pin-point. The application starts with a 256 channel filterbank. Approx 45 outputs are connected to files, a handful to other blocks ending with a custom block that puts messages in a GR message queue. The application has a separate thread that is constantly de-queueing items produced by my custom blocks. Occasionally, and randomly, one of the chains with my custom block appears to stall for an extended time and puts no messages into the queue. It appears it may restart at a random later time, and in every case I have observed restarting the application fixes the problem immediately. At the same time, another chain continues to send messages as I would expect. Is having two or more producers and one consumer on one GR message queue across multiple threads a bad idea? I'm not employing any additional locking on the queue, due to wishful thinking and ignorance. I could move to a one consumer for each producer model and it would not significantly change my application. Ryan ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] message queue problem in bbn_80211b_tx.py
Hi, all, I am trying to communicate between two USRP1 with the bbn_80211b_tx.py and bbn_80211b_rx.py. My OS is Ubuntu 10.10, but I have no idea what is my GNU Radio release(if anyone can help me to find out it, it will be very appreciated.) First, I tried to transmit the getty.txt. I run the command line as following: bbn_80211b_tx.py and got the output as following: Using TX d'board A: Flex 2400 Tx MIMO B >>> gr_fir_ccf: using SSE spb: 8 interp: 32 Sending pkt 0 sending... Sending pkt 1 sending... Sending pkt 2 sending... then it was just stuck there, no response at all, even I make ctrl+c. I had to kill the process to terminated it. By reading the code, I guessed the problem is related with the message queue, and I modified the message limit from 2 to 5, then it was stuck on 'Sending pkt 5'. So, I guessed the problem is, the packets in the message queue were not sent out at all, so when the message queue reached its limit, it just stopped. I have tried to look around for any possible resolution but didn't get any. Has anyone encountered the same problem before? Any suggestions will be very helpful! Thank you in advance! Xiang ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] message queue in grc
That's true, thank you Josh! Dimitris Symeonidis "If you think you're too small to make a difference, try sleeping with a mosquito!" - Amnesty International On Thu, Sep 10, 2009 at 20:16, Josh Blum wrote: > In the current master, there is a message source and message sink block in > grc. And you can create custom blocks with ports of type "msg" and connect > them! However, blocks with both a msg input AND a msg output are currently > unsupported. > > Also, It should be noted that this functionality will likely be removed when > we get PMTs up and running... and PMT based packet encoder/decoders for mac > layer and such/ > > -Josh > > Dimitris Symeonidis wrote: >> >> I have noticed that you can't add a message queue to a GRC flowgraph. Why >> is >> that? Is the reason technical, or that no one bothered to write the .xml >> file? >> >> And is the message queue going to be deprecated in gnuradio 3.3? >> >> Thank you >> >> Dimitris Symeonidis >> "If you think you're too small to make a difference, try sleeping with a >> mosquito!" - Amnesty International >> >> >> >> >> >> ___ >> Discuss-gnuradio mailing list >> Discuss-gnuradio@gnu.org >> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio > ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] message queue in grc
On Thu, Sep 10, 2009 at 12:13:21PM +0200, Dimitris Symeonidis wrote: > I have noticed that you can't add a message queue to a GRC flowgraph. Why is > that? Is the reason technical, or that no one bothered to write the .xml > file? > > And is the message queue going to be deprecated in gnuradio 3.3? The functionality provided by the existing message queue will be provided by a new mechanism. Eric ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] message queue in grc
In the current master, there is a message source and message sink block in grc. And you can create custom blocks with ports of type "msg" and connect them! However, blocks with both a msg input AND a msg output are currently unsupported. Also, It should be noted that this functionality will likely be removed when we get PMTs up and running... and PMT based packet encoder/decoders for mac layer and such/ -Josh Dimitris Symeonidis wrote: I have noticed that you can't add a message queue to a GRC flowgraph. Why is that? Is the reason technical, or that no one bothered to write the .xml file? And is the message queue going to be deprecated in gnuradio 3.3? Thank you Dimitris Symeonidis "If you think you're too small to make a difference, try sleeping with a mosquito!" - Amnesty International ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] message queue in grc
I have noticed that you can't add a message queue to a GRC flowgraph. Why is that? Is the reason technical, or that no one bothered to write the .xml file? And is the message queue going to be deprecated in gnuradio 3.3? Thank you Dimitris Symeonidis "If you think you're too small to make a difference, try sleeping with a mosquito!" - Amnesty International ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] message queue
On Fri, Aug 21, 2009 at 11:59:41PM -0700, shesh wrote: > > hi, >i am working on a spectrum sense code. in the following statement > self.msgq = gr.msg_queue(16) > is there any significance for the number 16?does changing this number > affect the performance of the code? > kindly help. It sets the limit to the number of messages in the queue. 0 means no limit. If the queue is full, an attempt to add a message will block until there's room. (Note also that gr_message_sink also has an option that will have it drop messages if the message queue is full.) Eric ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] message queue
hi, i am working on a spectrum sense code. in the following statement self.msgq = gr.msg_queue(16) is there any significance for the number 16?does changing this number affect the performance of the code? kindly help. -- View this message in context: http://www.nabble.com/message-queue-tp25091208p25091208.html Sent from the GnuRadio mailing list archive at Nabble.com. ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio