[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuradio-discuss
Subject:    Re: [Discuss-gnuradio] Clarification of lock() and unlock() in Dynamic Flow-Graph Reconfiguration
From:       Venkat Vinod <venkatvinod () gmail ! com>
Date:       2010-08-30 21:50:32
Message-ID: AANLkTinnVSkj_8=4ic+S7Rrkt5=X8nGa6hOpWaq0igYy () mail ! gmail ! com
[Download RAW message or body]

Hey,

We have tried just about every different combination of
start,stop,wait,lock, and unlock possible ....

Whenever we remove the stop() call, we get an error that we do not receive
whenever the stop() call is in place. With the stop() call removed, the
program gives us the following error at the unlock() statement:

                 *terminate called after throwing an instance of
'boost::thread_interrupted'*
                 *Aborted*

This error does not come up if we remove the stop() statement, but the
program freezes at the unlock instead. Any clues to solving the boost error
or what this actually means??

>From viewing the version 3.2.2 API
documentation<http://gnuradio.org/doc/doxygen/index.html>for the
gr_top_block class, there is a note saying that "the lock() and
unlock() methods should not be called from a flowgraph thread or the program
will be become deadlocked". In my program the lock() and unlock() are being
called from the same top_block() which is instantiated when the program is
started. Could this be the cause of freezing once we get to the unlock
statement?

Once again thanks for your help. I was extremely surprised at how quickly
you guys responded :)




 >
> > A couple of things to try:
> >Try removing the tb.stop() call, lock will stop the flowgraph anyway.
> >You may need to 'disconnect' (essentially undo all the connect calls) the
> path before recreating it. In the first instance try >the disconnect_all()
> method, but from memory that had some issues so you could try calling
> disconnect for each block which was connected.
>
>


> >             else:
> >               print "Receiver Mode : USRP to Switch to Receiving Packets
> "
> >               self.tb.stop()
>
> Don't call stop.  Just call lock.
>



-- 
Venkat Vinod Patcha and Ben Carroll

[Attachment #3 (text/html)]

Hey,<br><br>We have tried just about every different combination of \
start,stop,wait,lock, and unlock possible ....<br><br>Whenever we remove the stop() \
call, we get an error that we do not receive whenever the stop() call is in place. \
With the stop() call removed, the program gives us the following error at the \
unlock() statement:<br>

<br>                 <b>terminate called after throwing an instance of \
&#39;boost::thread_interrupted&#39;</b><br>                 <b>Aborted</b><br><br \
clear="all">This error does not come up if we remove the stop() statement, but the \
program freezes at the unlock instead. Any clues to solving the boost error or what \
this actually means?? <br>

<br>From viewing the <a href="http://gnuradio.org/doc/doxygen/index.html" \
target="_blank">version 3.2.2 API documentation</a>  for the gr_top_block class, \
there is a note saying that &quot;the lock() and  unlock() methods should not be \
called from a flowgraph thread or the  program will be become deadlocked&quot;. In my \
program the lock() and  unlock() are being called from the same top_block() which is 
instantiated when the program is started. Could this be the cause of 
freezing once we get to the unlock statement? <br><br>Once again thanks for your \
help. I was extremely surprised at how quickly you guys responded \
:)<br><br><br><br><br><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); \
padding-left: 1ex;">


<div>
&gt;
  <div>&gt; A couple of things to try:</div>
  <div>&gt;Try removing the tb.stop() call, lock will stop the flowgraph \
anyway.</div>  <div>&gt;You
 may need to &#39;disconnect&#39; (essentially undo all the connect calls) the 
path before recreating it. In the first instance try &gt;the <span \
style="font-family: &#39;Lucida Grande&#39;,Verdana,Geneva,Arial,sans-serif; \
font-size: 12px; font-weight: bold; white-space: nowrap;">disconnect_all() \
</span><span style="font-family: &#39;Lucida \
Grande&#39;,Verdana,Geneva,Arial,sans-serif; font-size: 12px; white-space: \
nowrap;">method, but from memory that had some issues so you could try calling \
disconnect for each block which was connected.</span><br>


    <br>
  </div>
</div>
</blockquote><div><br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: \
1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">&gt;             \
else:<br> &gt;               print &quot;Receiver Mode : USRP to Switch to Receiving \
Packets &quot;<br> &gt;               self.tb.stop()<br>
<br>
</div><div class="im">Don&#39;t call stop.  Just call \
lock.</div></blockquote></div><br><br><br>-- <br>Venkat Vinod Patcha and Ben \
Carroll<br><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic