C or C++?

Chris fj1200 at comcast.net
Sun May 29 21:11:02 EDT 2005


You should never use C++ in a real-time situation, simply becasue the 
constructors and destructors will be continually allocating memory, 
which is completely non-deterministic. A real-time system needs to be 
deterministic.



Jim Kuzdrall wrote:
> Greetings All,
> 
>     A military client arbitrarily added 2 contract requirements which I 
> have the opportunity to change.  I need some advice from your 
> collective experience to make certain I don't regret my choice a year 
> from now.
> 
>     The stipulations were: 1) use Linux; 2) use C++.
> 
>     The system is an embedded 32-bit DSP-type microcontroller (of my 
> choice) with about 1 megabyte of code.  It is battery operated and uses 
> prioritized, real-time interrupts to meet response time criteria.  The 
> software functions are "modular" and well defined.
> 
>     -no operator/user will input data to the processor; all inputs come 
> from hardware.
>     -the range of inputs is known (i.e. 256, 4096, 65536) so exhaustive 
> testing is feasible. 
>     -the software will rarely be revised; any change requires field 
> testing for re-qualification which costs about $1.5M.
>     -no Ethernet or networking (except via a radio network which is 
> separate layer beyond this).
>     -no disks or file storage facility.
>     -one serial port for diagnostics and up-loading the flash memory.
>     -few if any Standard Library functions are needed.
> 
>     It is nice to see their heart in in the right place with Linux, but 
> I see no reason for any operating system, so I am comfortable with 
> eliminating that.
> 
>     C++ versus C is my quandary.  Can anyone give me good reasons for 
> choosing one over the other in this case.  Opinions are welcome, but I 
> must have a list of reasons ready if my choice is questioned.
> 
> Jim
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
> 


-- 
IBA #15631



More information about the gnhlug-discuss mailing list