Re: [PATCH 06/18] chainlint.pl: validate test scripts in parallel
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Sep 6, 2022, 22:52 UTC
- Message-ID
- <CAPig+cSx661-HEr3JcAD5MuYfgHviGQ1cSAftkgw6gj2FgTQVg@mail.gmail.com>
- In-Reply-To
- <20220906223537.M956576@dcvr>
On Tue, Sep 6, 2022 at 6:35 PM Eric Wong <e@80x24.org> wrote:
Show 7 quoted lines
> Eric Sunshine via GitGitGadget <gitgitgadget@gmail.com> wrote:
> > +unless ($Config{useithreads} && eval {
> > + require threads; threads->import();
>
> Fwiw, the threads(3perl) manpage has this since 2014:
>
> The use of interpreter-based threads in perl is officially discouraged.Thanks for pointing this out. I did see that, but as no better alternative was offered, and since I did want this to work on Windows, I went with it.
Show 8 quoted lines
> I was bummed, too :< but I've decided it wasn't worth the > effort to deal with the problems threads could cause down the > line in future Perl versions. For example, common libraries > like File::Temp will chdir behind-the-scenes which is > thread-unsafe. > > (of course I only care about *BSD and Linux on MMU hardware, > so I use SOCK_SEQPACKET and fork() freely :>)
I'm not overly worried about the deprecation at the moment since (1) chainlint.pl isn't a widely used script -- it's audience is very narrow; (2) the `$Config{useithreads}` conditional can be seen as an automatic escape-hatch, and (if need be) I can even make `--jobs=1` be an explicit escape hatch, and there's already --no-chain-lint for an extreme escape-hatch; (3) the script is pretty much standalone -- it doesn't rely upon any libraries like File::Temp or others; (4) Ævar has ideas for using the Makefile for parallelism instead; (5) we can cross the deprecation-bridge when/if it actually does become a problem, either by dropping parallelism from chainlint.pl or by dropping chainlint.pl itself.