On 07/15/2013 05:43 PM, [email protected] 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 [email protected] > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > _______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
