C++ Logo

std-proposals

Advanced search

Re: [std-proposals] What a non-reallocating version of the standard would look like.

From: Jonathan Grant <jgrantonline_at_[hidden]>
Date: Wed, 3 Jun 2026 00:31:41 +0100
On 02/06/2026 03:12, Adrian Johnston wrote:
> Sorry guys.
>
> />> What way would you handle an issue identified by library hardening?/
>
> There are a lot of contexts:
>
> In finance I would not want to submit a stock trade or other financial transaction. In that case I might want to restart the program.
>

The risk with library hardening is that if it just instruments and checks accesses are within bounds, then it terminates if an issue is detected, that means it is not identified to the programmer via a helpful diagnostic at compile time (so isn't gracefully handled).

If a program exits, it needs another program to determine if it should be relaunched, but if your ./stocktrade program exits, surely restarting it may sometimes face the same issue? A repetitive loop of errors.

> Alternately, "hard real-time" is defined as a situation where a response is required within some number of milliseconds or machinery will be ruined or lives lost. And there is no tolerance of intermittently missing the deadline. In that case I might want to have multiple identical processes "locked" to multiple cores that are never shared. Each process tries to perform the same calculations. And then have a very simple arbitration system in place that can compare results for being identical and can handle if one process dies due to malfunction. That way I can reject the kind of mistake that could cause an industrial accident without causing delays.

That's good, having multiple machines, and then taking the result which ever completes first is a good approach.

>
> On a desktop app I might want to try to save my current state and restart. There is a list of text editors that keep their current state mapped to disk with mmap() and can recover from a crash by mapping their working memory right back in again after a restart.
>

Could you tell me which editors do that? The risk is the current state surely would contain the constraint violation that caused the error detected at runtime?

Regards
Jonathan Grant

Received on 2026-06-02 23:31:44