discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Weird threading problem


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Weird threading problem
Date: Wed, 28 Mar 2007 20:29:15 -0700
User-agent: Mutt/1.5.9i

On Wed, Mar 28, 2007 at 03:57:14PM -0700, Dan Halperin wrote:
> Hi,
> 
> So I made a loopback graph (file source, modulator, demodulator, file
> sink) with a short 1K file in it. The following code works (runs and
> exits without any exceptions):
> 
>         graph = loopback_graph()
>         print "starting"
>         graph.start()
>         print "started"
>         print "stopping"
>         graph.stop()
>         print "done"

Uhh, if you want the graph to finish before you kill it with stop(), 
I suggest:

>         graph = loopback_graph()
>         print "starting"
>         graph.start()
>         print "started"
>         print "waiting"
>         graph.wait()
>         print "done"


> As does the following:
> 
>         graph = loopback_graph()
>         print "starting"
>         graph.start()
>         print "started"
>         for x in range(1000):
>             for y in range(10000):
>                 pass
> #        print "stopping"
> #        graph.stop()
>         print "done"
> 
> But this does not:
> 
>         graph = loopback_graph()
>         print "starting"
>         graph.start()
>         print "started"
> #        for x in range(1000):
> #            for y in range(10000):
> #                pass
> #        print "stopping"
> #        graph.stop()
>         print "done"
> 
> It exits with this inscrutable message:
> 
>     >>> gr_fir_ccf: using SSE
>     starting
>     started
>     done
>     Unhandled exception in thread started by
>     Error in sys.excepthook:
> 
>     Original exception was:
> 
> So, discussion:
> 
> A) Case 2 should really print an exception, or a warning, or something
> right? Why would the application exit without any errors if I haven't
> stopped the flow graph? Or is it automatically stopped by the
> file_source exhausting its input?

It's stopped when the graph exhausts it's input (from the file source).

> B) There must be some competing thread issue in Case 3 that makes things
> go crazy, right? I should note I'm running this on a Intel(R) XEON(TM)
> CPU 2.20GHz with "4" cores - I think it has two multithreaded cores. I'm
> not sure, it's a few years old, but I've run into all kinds of weird
> thread problems in my apps on this machine that don't pop up in other
> machines with single cores or with a dual-core Athlon X2 TL-50.
> 
> -Dan

Hi Dan,

Does either the modulator or demodulator talk to python via messages?

Can you try this experiment again, using "wait" instead of "stop"?

If it still raises the exception, you you include the complete
traceback?

Thanks,
Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]