Date: Wed, 29 Nov 2023 16:52:17 +0100
> If you have spawned 6 threads, and if one of them freezes,...
one would re-write your thread code to include the ability to cancel the
thread and exit cleanly, surely?
A well-formed program does not "freeze".
On Tue, 28 Nov 2023 at 14:22, Frederick Virchanza Gotham via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> On Tue, Nov 28, 2023 at 1:16 PM Andrey Semashev wrote:
> >
> > This would result in UB or resource leak.
>
>
> When you program in the real world, stuff like this is sometimes
> necessary. If you have spawned 6 threads, and if one of them freezes,
> you can abandon the frozen thread and just start another one. I would
> however keep count of how many threads have been frozen so far, and
> when it reaches 12, tell the user that it's time to restart the
> program. The user will probably be done using the program before it
> climbs to 12.
>
> Or in the case of embedded programming, where you have a class
> managing a bus, and if the bus freezes up, you just want to abandon it
> and start afresh with a new object to manage the bus.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
one would re-write your thread code to include the ability to cancel the
thread and exit cleanly, surely?
A well-formed program does not "freeze".
On Tue, 28 Nov 2023 at 14:22, Frederick Virchanza Gotham via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> On Tue, Nov 28, 2023 at 1:16 PM Andrey Semashev wrote:
> >
> > This would result in UB or resource leak.
>
>
> When you program in the real world, stuff like this is sometimes
> necessary. If you have spawned 6 threads, and if one of them freezes,
> you can abandon the frozen thread and just start another one. I would
> however keep count of how many threads have been frozen so far, and
> when it reaches 12, tell the user that it's time to restart the
> program. The user will probably be done using the program before it
> climbs to 12.
>
> Or in the case of embedded programming, where you have a class
> managing a bus, and if the bus freezes up, you just want to abandon it
> and start afresh with a new object to manage the bus.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
Received on 2023-11-29 15:52:30