嵌入式或台式机实时系统的编码差异 [英] Difference in coding for Real time systems, Embedded or Desktop

查看:69
本文介绍了嵌入式或台式机实时系统的编码差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

programmnig实时系统,嵌入式和常规(桌面)系统有何区别?与台式机Linux或Windows系统相对,您需要在其中一种系统上使用c/c ++进行编程的特殊培训吗?它是用于编程的工具吗?或两者的结合,甚至是我在这里没有想到的东西.
在此先感谢.

What is the difference in programmnig Real time systems, embedded, and regular (desktop) systems. Is there special training you need to program in c/c++ on one of these systems as opposed to a desktop linux or windows system? Is it the tools used to program? or maybe a combination of the two or even something I haven''t thought of here.
Thanks in advance.

推荐答案

已经对这三种编程了,我必须说答案很大程度上取决于您的目标平台.例如,用于iPhone的编程肯定符合嵌入式的要求,但是所需的技能与用于Mac的编程几乎相同.另一方面,对定制硬件进行编程通常需要具备在线仿真器,逻辑分析仪甚至示波器的知识.通常也假定具有读取汇编语言的能力和二进制操作中的相对流利性.

通常,嵌入式系统的程序员必须更加了解其内存使用情况:以单位数 kilo 字节表示系统内存的情况并不罕见.很多时候您没有操作系统,因此您需要完全了解底层的硬件交互,中断,硬件计时器等.

实时编程需要完全不同的思维方式.您使用的语言仅次于您对资源,同步,计划,内存分配,尤其是算法的思考方式.例如,摊销的线性时间算法不符合线性时间算法的要求,快速排序在您的脑海中变成O(N ^ 2),而主流事物(例如惰性初始化)变得完全不相关.预先分配已成为日常工作,正式验证最关键的代码成为必要条件,而不是奢侈的事情.最重要的是,实时操作系统所提供的服务与您在典型的台式机上所发现的服务不同,因此还需要进行很多其他的学习.
Having programmed all three kinds, I must say that the answer depends a lot on your target platform. For example, programming for iPhone definitely qualifies as embedded, yet the skills you need are nearly identical to what you need to program for Mac. On the other hand, programming custom hardware would often require a working knowledge of in-circuit emulators, logic analyzers, and perhaps even oscilloscopes. An ability to read assembly language and relative fluency in binary operations is often assumed as well.

In general, programmers of embedded systems must be a lot more conscious about their memory use: situations when the system memory is expressed in single-digit kilobytes are not unusual. Very often you would have no operating system, so you''d need to fully understand low-level hardware interactions, interrupts, hardware timers, etc.

Real-time programming requires a different mindset altogether. The language you use becomes secondary to the way you think about resources, synchronization, schedules, memory allocations, and especially algorithms. For example, amortized linear-time algorithms do not qualify as linear-time algorithms, quick sort becomes an O(N^2) in your mind, and mainstream things such as lazy initialization become completely irrelevant. Pre-allocation becomes the order of the day, and formal verification of your most critical code becomes a requirement, not a luxury. On top of that, real-time operating systems present services that are different from what you would find on a typical desktop, so a lot of additional learning is in order.


我已经多年来发现这很有帮助:
ACE [ http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/ACE-INSTALL.html [ ACE,TAO和CIAO成功案例 [ ^ ],这实际上是火箭科学,并且具有已用于许多严肃的实时应用程序.

问候
Espen Harlinn
I''ve found this quite helpful over the years:
ACE[^]

You''ll find some info about supported OS''es, including Windows CE, pSOS, QNX Neutrino, and VxWorks, here:http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/ACE-INSTALL.html[^]

As can be seen from the ACE, TAO, and CIAO Success Stories[^], this IS actually rocket science, and it has been used for quite a number of serious real-time applications.

Regards
Espen Harlinn


这个问题真的太笼统了,无法回答.通常,对于实时系统,您将使用RTOS而不是Windows之类的通用OS.对于嵌入式"系统,它们的范围从没有操作系统的简单设备,最小的内存和仅一个C编译器,到功能强大的微型计算机,甚至都可以使用Java之类的高级语言进行编程.
The question is really too generic to answer. In general, for real-time systems you are going to use a RTOS rather than a general-purpose OS like Windows. As for "embedded" systems they range from simple devices with no OS, minimal memory and only a C compiler, to powerful mini-computers that can be even programmed with high-level languages like Java.


这篇关于嵌入式或台式机实时系统的编码差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆