Skip to Content
Programming Embedded Systems in C and C++
book

Programming Embedded Systems in C and C++

by Michael Barr
January 1999
Beginner to intermediate
200 pages
7h 43m
English
O'Reilly Media, Inc.
Content preview from Programming Embedded Systems in C and C++
122 Chapter 8: Operating Systems
Of course, if interrupts are ever disabled within the operating system, the worst-
case interrupt latency increases by the maximum amount of time that they are
turned off. But as we have just seen, there are many places where interrupts are
disabled. These are the critical sections we talked about earlier, and there are no
alternative methods for protecting them. Each operating system will disable inter-
rupts for a different length of time, so it is important that you know what your sys-
tem’s requirements are. One real-time project might require a guaranteed interrupt
response time as short as 1 µs, while another requires only 100 µs.
The third real-time characteristic of an operating system is the amount of time
required to perform a context switch. This is important because it represents over-
head across your entire system. For example, imagine that the average execution
time of any task before it blocks is 100 µs but that the context switch time is also
100 µs. In that case, fully one-half of the processor’s time is spent within the con-
text switch routine! Again, there is no magic number and the actual times are usu-
ally processor-specific because they are dependent on the number of registers that
must be saved and where. Be sure to get these numbers from any operating sys-
tem vendor you are thinking of using. That way, there won’t be any last-minute ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

You might also like

Embedded Systems Object-Oriented Programming in C and C++

Embedded Systems Object-Oriented Programming in C and C++

Israel Gbati

Publisher Resources

ISBN: 1565923545Catalog PageErrata