[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] GRAS flow control from work function
From: |
Josh Blum |
Subject: |
Re: [Discuss-gnuradio] GRAS flow control from work function |
Date: |
Mon, 15 Jul 2013 17:48:31 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 |
On 07/15/2013 05:43 PM, address@hidden wrote:
> Hi,
>
> I'm using gras for my application and my custom block needs to be
> able to do a blocking read to get data from an external source. With
> the standard scheduler I used a non blocking read in a polling loop
> with an interruptable sleep and this worked Ok. Do I need to do it
> this way with gras or can I get away with with blocking?
>
Basically, you want to avoid stealing away the work() thread for too
long. So I recommend polling with a small timeout and return if there is
nothing. Work will get called again.
Relevant discussion:
http://lists.gnu.org/archive/html/discuss-gnuradio/2013-05/msg00124.html
> Another thing my block must do is stop the flow graph if its external
> source has signaled that it is done. I did this with the standard
> scheduler by returning WORK_DONE. How should this be done with gras?
>
>
Use this->mark_done()
https://github.com/guruofquality/gras/blob/master/include/gras/block.hpp#L213
-josh
> Thanks. -- Regards, Devin
>
>
>
>
> _______________________________________________ Discuss-gnuradio
> mailing list address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>