Linux' hrtimer - microsecond precision?

前端 未结 2 1900
感动是毒
感动是毒 2021-01-03 03:21

Is it possible to execute tasks on a Linux host with microsecond precision? I.e., I\'d like to execute a task at a specific instant of time. I know, Linux is no real-time sy

2条回答
  •  -上瘾入骨i
    2021-01-03 03:54

    The default Linux kernel timer ticks each millisecond. Microseconds is way beyond anything current user hardware is capable of.

    The jitter you see is due to a host of factors, like interrupt handling and servicing higher priority tasks. You can cut that down somewhat by selecting hardware carefully, only enabling what is really needed. The real-time patchseries to the kernel (see the HOWTO) might be an option to reduce it a bit further.

    Always keep in mind that any gain has a definite cost in terms of interactiveness, stability, and (last, but by far not least) your time in building, tuning, troubleshooting, and keeping the house of cards from falling apart.

提交回复
热议问题