On Tue, Apr 1, 2014 at 12:23 AM, Philip Guenther <guent...@gmail.com> wrote:

> I *sounds* like the problem you're trying to solve** is some thing like
>      I want to efficiently read data from a serial line, returning
> whenever at least
>      250 bytes are available or when more then 0.1s has passed.
>      If no data is received, it should still return after 0.1s.

No, read() should not return 10 times per second when there is "no
data". It must depend on VMIN and VTIME. When 1 byte becomes
available, the 0.1 timer starts, and further bytes do not restart it.
A call to read() returns when VMIN is satisfied, or the timer expires
by reaching 0.1. Tthe timer must not be "interbyte," restarted by
further bytes. The worst case I described continually resets an
interbyte timer, pushing it into the future, until VMIN overcomes the
effect. That can take up to 20 seconds.


> Is that an accurate description of what you're actually trying to do?
> Do you see the difference between that description and what you wrote?

Your wording is different. But superior? No so sure. As for the
problem, I'm not deaf to alternate solutions. Do you have one?


> something you're really trying to do?  Your posts make it sound like
> this is a hypothetical and not something you're actually facing.

Is it always safe to ignore hypothetical problems?

Reply via email to