C++ Logo

std-proposals

Advanced search

Re: [std-proposals] void std::optional<T>::abandon(void) noexcept

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Tue, 28 Nov 2023 14:59:58 +0000
On Tue, Nov 28, 2023 at 2:37 PM Andrey Semashev wrote:
>
> When your thread unexpectedly blocks for unknown duration, your proposed
> abandon() method is not the solution. Not in a "real world" program,
> anyway. (In your toy project that noone will ever use you can do
> whatever, but that doesn't necessitate changing the standard.)


Not getting snotty with you Andrey but the program that I wrote, and
which I'm currently tweaking, is currently being used by a dozen of my
colleagues in five countries that I know of.

Occasionally a thread freezes up . . . . and rather than have the
frustration of having to close and re-open the program, I just abandon
the thread. Obviously this would get hairy if a thread froze up every
20 seconds, but it rarely happens -- more like once or twice a day.

But this isn't about the one program that I wrote. I think in general
an 'std::optional' should be able to abandon its object.

Received on 2023-11-28 15:00:12