Problem with thread scheduler

I have a problem with the thread scheduler in GNU Radio. I am using USRP
N210

  • RFX 2400 daughterboards with UHD. When I run my spectrum sensing
    codes, if
    I stop the flowgraph it will show the thread-per-block number mismatch
    error
    message on screen. I wonder if there is any way to get rid of this
    problem.
    My BOOST version is 1.40 and I am using Ubuntu 10.04. UHD information is
    shown below:

[email protected]:/usr/local/src/gnuradio/build# uhd_find_devices
linux; GNU C++ version 4.4.3; Boost_104000;
UHD_003.004.002-181-g25649781

View this message in context:
http://old.nabble.com/Problem-with-thread-scheduler-tp34213396p34213396.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On 07/29/2012 03:57 PM, cdong8812 wrote:

I have a problem with the thread scheduler in GNU Radio. I am using USRP N210

  • RFX 2400 daughterboards with UHD. When I run my spectrum sensing codes, if
    I stop the flowgraph it will show the thread-per-block number mismatch error
    message on screen. I wonder if there is any way to get rid of this problem.

Can you post the error message?

-josh

Hi Josh,
Thank you for the quick reply. I have went through previous post and
find
one that had been fixed by your latest UHD build then. However I found
this
annoying problem again with latest master build and N210. The structure
of
my code is as follows:
Class Wimax_Receiver(gr.top_block):

def add_fft_cal(self, fft_cal_block):

    # Get new block

self.FFT_calculate = fft_cal_block

Add FFT to output of USRP

self.connect(self.u, self.FFT_calculate)

class FFT_Calculation(gr.top_block):

self.wr = Wimax_Receiver()
self.wr.add_fft_cal(self.s2v)
self.connect(self.s2v, self.fft_cal, self.c2mag, self.log,
self.stats)
self.connect(self.wr)

Below is the error message:

http://old.nabble.com/file/p34235614/QQ%E6%88%AA%E5%9B%BE20120731121754.jpg

Josh B.-3 wrote:

error

[email protected]:/usr/local/src/gnuradio/build# uhd_find_devices
linux; GNU C++ version 4.4.3; Boost_104000; UHD_003.004.002-181-g25649781


Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/Problem-with-thread-scheduler-tp34213396p34235614.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On 07/31/2012 09:27 AM, cdong8812 wrote:

    # Get new block

self.stats)
self.connect(self.wr)

Below is the error message:

http://old.nabble.com/file/p34235614/QQ%E6%88%AA%E5%9B%BE20120731121754.jpg

Well, unless I am misreading, it seems like the flow graph finished
execution.

Are you on ubuntu 10.04 by any chance? I know that the boost on that
version, well its thread interrupt causes the various blocking mutex,
cond, locks, etc to throw uncatchable exceptions… its unfortunate.

If thats not the explanation and its bombing, do you know what call,
what line is the cause?

-josh

Yeah, I’m using Ubuntu 10.04. Maybe I should make it more clear about
the
structure of my code. Actually I’d like the spectrum sensing program to
run
for a certain time and then quit. So I add a time control in my code.
Below
is a more detailed structure:
Class Wimax_Receiver(gr.top_block):

def add_fft_cal(self, fft_cal_block):

    # Get new block
    self.FFT_calculate = fft_cal_block

    # Add FFT to output of USRP
    self.connect(self.u, self.FFT_calculate)

class ThreadClass(threading.Thread):

class tune(gr.feval_dd):

class parse_msg(object):

class FFT_Calculation(gr.top_block):

self.wr = Wimax_Receiver()
self.wr.add_fft_cal(self.s2v)
self.connect(self.s2v, self.fft_cal, self.c2mag, self.log,
self.stats)
self.connect(self.wr)

def set_center_freq(self):
do something for time control and stop flowgraph by tb.stop()

def main_loop(tb):

print out FFT amplitude and frequency information

if name == ‘main’:

# Initiate a thread to run the program
tr = ThreadClass()
tr.start()

# Create an object of FFT block
tb = FFT_Calculation()

try:

Run the main block

    tb.run()
    main_loop(tb)

except KeyboardInterrupt:
    pass

From the error message, I guess it’s because when I shut down the
flowgraph
in the set_center_freq function the usrp_uhd block is still streaming
but
the thread scheduler has already terminate thread allocation for it. So
in
order to avoid this issue, you recommend to update Ubuntu to 11 or 12? I
really appreciate it if you could help me fix this problem.

Josh B.-3 wrote:

of

error
shown below:


Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/Problem-with-thread-scheduler-tp34213396p34246603.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Hi Josh,
I’d really appreciate your help if you could help me fix this issue as
soon
as possible because I do need to fix it for my project in a very short
time.
Thank you.

Best,

Chen

Josh B.-3 wrote:

of

error
shown below:


Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/Problem-with-thread-scheduler-tp34213396p34258128.html
Sent from the GnuRadio mailing list archive at Nabble.com.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs