Time, Clocks, Timers And Notification#

Time is a complex topic, even with computers omitted from the picture. This section, naturally, discusses how time - and timers (notifications of time-related events) - are handled in Linux.

Starting with a discussion of clock variants, and various ways to synchronously defer execution, we try to cover the vast amount of notification possibilities. (I’ll try to not be too judgy on the way, but you might know my preferences anyway regarding asynchronous signal delivery.)

Details#

Limits, Anywhere?#

  • max # timers: code/posix-maxtimers.cpp -> 62207

    $ ulimit -a
    ...
    pending signals                     (-i) 62209
    ...
    

    From man -s 2 timer_create

    NOTES section#
    The kernel preallocates a "queued real-time signal" for each
    timer created using timer_create().  Consequently, the number of
    timers is limited by the RLIMIT_SIGPENDING resource limit (see
    setrlimit(2)).
    

Timer Overrun#

Continue from code/posix-overrun.cpp