Embedded C++ : to use exceptions or not?

后端 未结 4 1864
花落未央
花落未央 2020-12-12 22:01

I realize this may be subjective, so will ask a concrete question, but first, background:

I have always been an embedded software engineer, but usually at Layer 3

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 23:04

    The most problem with exceptions -- they don't have predictable time of execution. Thus they are not suitable for hard real-time applications (and I guess most embedded application doesn't fall in this category).

    The second is (possible) increasing of binary's size.

    I would propose you reading of Technical Report on C++ Performance which specifically addresses topics that you are interested in: using C++ in embedded (including hard real-time systems) and how exception-handling usually implemented and which overhead it has.

提交回复
热议问题