--- In "BxWen" <> wrote:
>
> Hi:
>
> I am trying to receive some data from /dev/ttts2. The data come in at a rate
> of 1 byte per 5 millisecond. What I want is to response to this one byte data
> every 5 millisecond. But I actually receive nothing, or 2 bytes at 10
> millisecond interval. Is this a Linux kernel thing so that I can only read
> every 10 millisecond? What should I do to make the system response faster?
>
> Thanks.
>
> bing
>
It is a kernel thing. The default scheduling interval is 10mS, so if your
process is sleeping waiting for data, it will only be woken up every 10mS. In
order to avoid this, you can either change the kernel to a shorter scheduling
interval or not go to sleep. I would set the scheduling interval to 3 or 4mS
in order to get your data at 5mS intervals.
If you open the serial device O_NONBLOCK then use select with a zero timeout to
poll for data, you can respond to data immediately. This does mean you will
run at 100% CPU utilisation and no other process will get a look in. This may
or may not be a problem.
I think some of the other responses to your question may have missed the point
as it's not a baud rate question.
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|