[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Freeze when writing to linux fifo pipe
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] Freeze when writing to linux fifo pipe |
Date: |
Wed, 21 Apr 2010 20:26:00 -0700 |
User-agent: |
Mutt/1.5.20 (2009-08-17) |
On Tue, Apr 20, 2010 at 02:57:04PM +0200, Joachim Roop wrote:
> Hi,
> I am trying to write to a linux pipe/fifo, but sadly this seems to freeze
> python. I am using Ubuntu 10.04 and gnuradio 3.2.2.dfsg-1ubuntu1.
> Please try to execute the code and tell me why this makes the app pause.
$ man 3 mkfifo
Opening a fifo for reading blocks until there is a writer and vice versa...
Eric
>
> #! /usr/bin/python
>
> # Import stuff
> from gnuradio import gr, gru, eng_notation, optfir
> from gnuradio.eng_option import eng_option
> from gnuradio.wxgui import slider, powermate
> from gnuradio.wxgui import stdgui2, fftsink2, form, scopesink2
> import sys
> import os
>
> # Main application
> class main_app (stdgui2.std_top_block):
> def __init__(self,frame,panel,vbox,argv):
> stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
>
> print '!!!Cleanup'
> os.spawnlp(os.P_WAIT, 'rm', 'rm','/tmp/gnutest1.raw')
> os.spawnlp(os.P_WAIT, 'rm', 'rm','/tmp/gnutest2.raw')
> print '!!!make a fifo'
> os.spawnlp(os.P_WAIT, 'mkfifo', 'mkfifo','/tmp/gnutest1.raw')
> print '!!!make file sink without the fifo'
> outok = gr.file_sink(gr.sizeof_short,'/tmp/gnutest2.raw')
> print '!!!make file sink with the fifo (FREEZING)'
> outcrash = gr.file_sink(gr.sizeof_short, '/tmp/gnutest1.raw')
> print '!!!everything went better than expected'
>
> if __name__ == '__main__':
> app = stdgui2.stdapp (main_app, "crashtest")
> app.MainLoop ()