Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2006-02-17 14:48:09


Hi Andy,

> Ok ...thanks for the example. Though it raise a lot of questions which perhaps
> cant be anwered. As I understand it the no-exceptions requirement in this
> example is a policy based on the fact that exceptions for error recovery have
> been found to be too slow to respond?

As Dave mentioned exception handling can be slow when there is an error.
As a general recommendation, many embedded system enterprises don't use
exceptions (yes, including EC++ group). Technical Report on C++ (N1668)
Performance confirms that a "code" exception implementation has run-time
overhead in normal code but a "table" exception has no runtime overhead
in normal code. However there is a space overhead. N1668 reports 15%
overhead in size from one vendor. But the problem is predictability.

There also international norms that regulate what languages can be used
depending on security/reliability levels in some areas. Those norms
state that only a subset of C++ can be used to program some
security/reliability equipment. That subset does not include exceptions,
so many times you are forced to avoid exceptions. Many enterprises take
the decision to program without exceptions for all embedded devices
because they don't know if in the future a developed code can end in one
of those devices. If you need more information about exceptions N1668
has some good explanations.

> I am now wondering though if the change over to RAII is going to have other
> unwelcome side-effects on a design that has not been designed around it? This
> is pure speculation. I havent looked deeply into the matter.

I don't think so.

> Also are you reasonably happy with that decision (RAII only for Shmem)? I
> guess it is not too helpful for the application above for example.

Well, not *very* happy, but the point is that I should implement what
boosters want. If in the future there are requests for a non-throwing
alternative interface, that can be discussed and developed in the
future. But this will be more needed in threads, since there are
hard-realtime embedded systems without exceptions but using threads.
You always have the option to use the C API.

This RAII issue is closed to me. Now I have a lot for work to do for the
final Shmem version.

Regards,

Ion


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk