Slashdot Mirror


Ultra-Stable Software Design in C++?

null_functor asks: "I need to create an ultra-stable, crash-free application in C++. Sadly, the programming language cannot be changed due to reasons of efficiency and availability of core libraries. The application can be naturally divided into several modules, such as GUI, core data structures, a persistent object storage mechanism, a distributed communication module and several core algorithms. Basically, it allows users to crunch a god-awful amount of data over several computing nodes. The application is meant to primarily run on Linux, but should be portable to Windows without much difficulty." While there's more to this, what strategies should a developer take to insure that the resulting program is as crash-free as possible? "I'm thinking of decoupling the modules physically so that, even if one crashes/becomes unstable (say, the distributed communication module encounters a segmentation fault, has a memory leak or a deadlock), the others remain alive, detect the error, and silently re-start the offending 'module'. Sure, there is no guarantee that the bug won't resurface in the module's new incarnation, but (I'm guessing!) it at least reduces the number of absolute system failures.

How can I actually implement such a decoupling? What tools (System V IPC/custom socket-based message-queue system/DCE/CORBA? my knowledge of options is embarrassingly trivial :-( ) would you suggest should be used? Ideally, I'd want the function call abstraction to be available just like in, say, Java RMI.

And while we are at it, are there any software _design patterns_ that specifically tackle the stability issue?"

6 of 690 comments (clear)

  1. obvious answer by cameronpurdy · · Score: 0, Flamebait

    > what strategies should a developer take to insure that the resulting program is as crash-free as possible? First, avoid using C++.

  2. Oh come on... by wbren · · Score: 1, Flamebait
    The application is meant to primarily run on Linux, but should be portable to Windows without much difficulty.
    Well there's your problem.

    I know: -1 Flamebait. But really, this is Slashdot. A story with such a minor reference to Windows going without a Windows-bashing comment for this long is just inexcusable.
    --
    -William Brendel
  3. Why stop there? by davebo · · Score: 0, Flamebait

    Here's a better request: "I want an ultra-stable, crash-free application in C++ and a pony."

    Anyone that would think it'd be a good idea to Ask Slashdot(tm) for advice on how to write the program you described isn't smart enough to write said program. Seriously. Call your boss/manager/lab supervisor/cult leader and tell them to find somebody else for the job, because you will fuck it up just as sure as the sun will rise.

    And for all of you folks suggesting this guy/gal writes it in Python/Perl/.Net/Whatever instead of C++, give it a rest. Please. Does the questioner sound like the kind of person that would bother to write exception handlers? That would even bother to buy a frickin' book already to find out what an exception was? No, they do not.

    Christ. I'm sick of this sea of idiots.

  4. Yeah, c++ hasn't been successfully used before... by composer777 · · Score: 1, Flamebait

    Use your brain. C++ is a very commonly used language. If you can't write an application that is stable, consider another career. The only people I know who criticize a widely used language like c++ are posers and hacks. Think about it, the linux kernel is written in an even lower level language (C), and it's fairly stable. Sorry for the harshness, but I have the displeasure of working with a guy (like you), that complains about having to do serious design, and prefers to write in PERL, becuasue it's easy to use. Designing fast, scalable, stable programs is part of our profession. Either get with the program, or get out. Sorry if I didn't answer your question, but I don't consider it honest.

  5. Re:Python is second only to Love by James_Aguilar · · Score: 0, Flamebait

    Maybe those other people should learn when I'm trying to be funny and when I'm trying to be serious? Do you think that I'm trying to make a logical argument by comparing Python and love? It's just supposed to be a tongue in cheek assessment of a language that I really do like, but not quite that much. You, on the other hand, are free to not like Python and, moreover, not use it, so I don't see the reason you should be complaining.

  6. Re:You're not the first one.... by Soybean47 · · Score: 0, Flamebait

    So, just to clarify... what you're decribing is a fantastic way to be second best? ;)