tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: select() timeout



In article <20120203120857.GA28362%kyyhky.embedtronics.fi@localhost>,
Jukka Marin  <jmarin%embedtronics.fi@localhost> wrote:
>I guess it's better to post this here as well:
>
>Hi,
>
>How does timeout of select() work for short timeouts (less than timecounter
>tick period)?  I am working on a serial bus protocol where the master first
>sends out a data packet and then waits for a reply from a slave.  Timecounter
>tick is 10 ms on this box (a net5501) and I would like to use timeouts of
>1 ms or even less when data bytes are coming in.
>
>I was using a fixed 20 ms timeout and the protocol was working ok for most
>of the time, but sometimes I got a burst of receive timeouts.  I'm not sure
>if the data is held in the tty buffers or if my timeout logic is failing yet.
>
>So, are short timeouts reliable with select()?
>

You should be using pollts() instead.

christos



Home | Main Index | Thread Index | Old Index