C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Paper for Preventing Re-entry of Functions (10 pages)

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Sun, 19 Feb 2023 14:24:40 -0500
Hear hear.

I did get nerdsniped enough to implement a `class ReentryPreventer`
synchronization primitive along Frederick's lines; but the example on Page
6 seems unimplementable without a ton of heap-allocation, which obviously
won't fly even as a library solution.
https://godbolt.org/z/Kebvbv4cW

The trick, as always, is to figure out *what you want this class type to do*,
and then implement that. Right now Frederick has it "doing" about 10
different things, which makes it impossible to implement, of course. You
have to figure out in words *what it does*, first; and then you can
implement it from that.

–Arthur


On Sun, Feb 19, 2023 at 11:20 AM Jason McKesson via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On Sun, Feb 19, 2023 at 11:15 AM Frederick Virchanza Gotham via
> Std-Proposals <std-proposals_at_[hidden]> wrote:
> >
> > On Sun, Feb 19, 2023 at 4:00 PM Ville Voutilainen
> > <ville.voutilainen_at_[hidden]> wrote:
> > >
> > > P.S. Somewhat tongue in cheek: I don't think the proposal has enough
> > > keywords for use cases virtually nobody needs.
> >
> >
> > If it's more to your palate, replace all the keywords I proposed with
> > std::[keyword].
>
> Those sorts of things have been proposed and rejected. The point I
> believe Ville was trying to make is that the feature you want to have
> is not widely useful enough to need a keyword. Which suggests that
> it's not widely useful enough to need to be in the language at all.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2023-02-19 19:24:54