C++ Logo

std-proposals

Advanced search

Re: Signals & Slots

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 27 Jul 2021 10:03:24 -0700
On Tuesday, 27 July 2021 02:37:48 PDT Antoine Viallon via Std-Proposals wrote:
> And, for reference, new code bases don't have signal handling code. And I
> really think POSIX signal handling helpers in the STL would make
> everybody's life easier.

I really don't think so. There are just too many pitfalls for signal handling
and too limited use that I don't think it should be part of the *standard*.

I agree that people who need to use them should have an easy to use API that
is hard to get things wrong. So there should be a really good library to
implement the functionality, one we can point people to.

I just don't think it should be the standard library.

The one exception is SIGCHLD, but only in the abstracted sense of starting a
subprocess and handling its exit. This is something I'd like to see in the
standard library, matching POSIX popen() functionality and Python's
Subprocess. But whether it uses SIGCHLD or some other mechanism should be
irrelevant and never be exposed in the API.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2021-07-27 12:03:30