3

i want to understand what is meant by operating system tick time and what is the use of it ?

and how it is different from CPU tick rate

user3719428
  • 51
  • 1
  • 1
  • 2

1 Answers1

6

The system tick is the time unit that OS timers and delays are based on. The system tick is a scheduling event - i.e. it causes the scheduler to run and may cause a context switch - for example if a timer has expired or a task delay completed.

If the RTOS supports round-robin/time-sliced scheduling of tasks of the same priority, the OS tick may cause a context switch directly without the task requesting a delay or timer event.

The system tick interrupt is not the only scheduling event, other mechanisms and events may cause scheduling asynchronously to the system tick.

An RTOS system tick period will typically be in the order or 1ms to 100ms, but may be longer or shorter. The overhead of running the scheduler is increasingly significant the shorter the period, so there is a trade off between timer resolution and CPU overhead. In many cases real-time response does not rely on timer resolution because events generate interrupts that cause the scheduler to run asynchronously to the clock.

Take a look at Fundamentals of Real-Time Operating Systems for a good overview of RTOS. Part 17 in particular is relevant to this question.

Clifford
  • 88,407
  • 13
  • 85
  • 165
  • I still don't get from which harware component the OS is based on in order to tick. – Ayoub Omari Apr 27 '20 at 00:28
  • @Sarmon That is not addressed in this answer because that was not the question. Perhaps you could post your own question? Briefly, it is implementation/hardware dependent, but generally any configurable time source capable of generating a periodic interrupt can be used. – Clifford Apr 27 '20 at 06:34