[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] Source block question: internal sleep loop or let GR
From: |
Monahan-Mitchell, Tim |
Subject: |
[Discuss-gnuradio] Source block question: internal sleep loop or let GR scheduler handle empty read? |
Date: |
Mon, 6 May 2013 22:09:46 +0000 |
Looking at some source block examples (audio jack, comedi, file source, etc.),
sometimes I see a sleep() called inside the work function when there is no data
to read, sometimes not (noutputitems = 0).
For a real file, not sleeping and returning noutputitems = 0 makes perfect
sense.
For a stream device, using fread(), what are the pros/cons of the work loop
sleeping if fread is empty, or letting the scheduler decide?
If I can influence the implementation of the device driver, similar question on
pros/cons if the driver sleeps (or schedules) instead if there is no data yet,
or just returns an empty read?
(ignore endless looping for these questions, that could be detected)
I will be using GR v3.7 when available.
Thanks in advance,
Tim
- [Discuss-gnuradio] Source block question: internal sleep loop or let GR scheduler handle empty read?,
Monahan-Mitchell, Tim <=