Bill Allombert on Sat, 12 Oct 2024 20:38:40 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: PARI with --enable-tls
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: PARI with --enable-tls
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sat, 12 Oct 2024 20:38:36 +0200
- Delivery-date: Sat, 12 Oct 2024 20:38:40 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.u-bordeaux.fr; s=2022; t=1728758318; bh=B44IGZknN9ul9GXq09ZUiDMo54Mz7u5lXwRaHTM4ghA=; h=Date:From:To:References:In-Reply-To:From; b=DMvLH05Pbq7k6hy9BMgfHRKM7QZ+8ZBjngHdLwNed0G3aD2RTJ/EEkObrgbT1PCm3 lbeU4M6RokJ5gqtnGwW2f55PwPCrfetOC83l5Cwx5ZozxLBblJj807z9ku/puNA8uE 6HJFD19xfGRX51Tx3vk0jXG1POzCryXLAWyjidpXJpE1rr6dWTw6Z3DrUlK8pPmI6C TlsDHE9RYNAm9nCSyut5PP+0ONrbxPSLVBDkOmKw1ePhclxT40CvISZbOkzjOl6d/B On45Zz1w0iDK2llYNwupVlsIMes34XDxtqYBSVIQO6y5ONWbder50YUjIWGe0o5n5j 17HbyRJgaQWJRFuhkpRgjQGIjjbDomQUy8w22DOHwMRMPJq1iU3cdYgBs+0Bp2AGRL Lhtt2GLyQ1f2H6hzi1iXGu5MxV3jnaSuqdFfwwaTx8mlMt7ekpZrJ+vzAnZzohDm4U 2zs9GkJ2rAW2NisecIaBdCobZhrNtk8N2Hdr8kyYVn6iMcccUtuCdGoKgyTyrHumU5 3PriJJt/jW2VFvVCtwHTDRwRg0j4/QXbquYs8+oHi2XgurAVzXXIuDsbzNUZS9RrEH t04Tlyyr4QJLbyl2XR2jfX0lgREJKHtddc9G+6FszGZR3416PEdy5Tjun13vB9dkfQ 1OtrkwGNP8X5Qg1ghYCq4xYg=
- In-reply-to: <CAJkPp5O_tYaERSa0yCYLSfbVrsf=JOQ89aUc_y5SrmZa-ML-Jw@mail.gmail.com>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <CAJkPp5O_tYaERSa0yCYLSfbVrsf=JOQ89aUc_y5SrmZa-ML-Jw@mail.gmail.com>
On Sat, Oct 12, 2024 at 08:55:31AM -0400, Max Alekseyev wrote:
> Hello,
>
> Pari can be compiled with the option:
> --enable-tls enable thread-local stack
>
> What are the advantages/disadvantages of using it? (with combination of
> --mt=pthread if that matters)
As Karim says, --mt=pthread implies --enable-tls.
With --enable-tls without --mt=pthread, gp will behave exactly as --mt=single,
but it will be possible to write multi-threaded libpari programs that use the
raw POSIX thread interface, see example examples/thread.c.
This is also possible with --mt=pthread, but --mt=pthread also allow to write
multi-threaded libpari program that use the PARI mt interface, see
examples/pari-mt.c.
As Karim says again, using --enable-tls and --mt=pthread incur a slowdown of
libpari due to the use of TLS variables.
To reduce it, two options that are cumulatives:
- use gp-sta instead of gp-dyn
- use the compiler/linker flag -flto
Cheers,
Bill.