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?"

2 of 690 comments (clear)

  1. Re:You're not the first one.... by batkiwi · · Score: 0, Troll

    So what instances do you have on hand of a C# solution working but generating invalid results which would not have occured by using C++? You made a huge inline claim without really ANY backup!

  2. Re:You're not the first one.... by root-a-begger · · Score: 0, Troll

    Doing it all in C++ is certainly asking for trouble. I do recognize your assertion that it all must be C++, but this assertion needs to be seriously rethought. Its by far not the best choice of langugage for your stated requirements.
    The bottom line is, if you need performance and already have most of this in C/C++ libraries, then use them.
    For the overall system, UI, inter-proc communications, concurrency, etc... don't use C++.
    My plug is for you to use erlang (yes I'm serious www.erlang.org) for the entire system and make your C/C++ library calls through that. You will get great performance and not have to worry about system stability, portability and concurrency. Respost your question to the erlang questions maillist and you will get very well thought out responses.
    If you choose to do absolutely everything in C++, your just wasting time, money and the slashdot community's time as well since this type of question has well been answered in the past.
    Feel free to get in touch if you need more charitable info on why erlang is the best choice for the encompassing system archtecture.
    good luck