gpt4 book ai didi

multithreading - 为什么默认情况下没有设置线程 Perl(使用 usethreads)?

转载 作者:行者123 更新时间:2023-12-03 13:16:32 24 4
gpt4 key购买 nike

根据INSTALL docs ,

On some platforms, perl can be compiled with support for threads. To enable this, run

sh Configure -Dusethreads

The default is to compile without thread support.

既然线程实现相当稳定,为什么它不是默认的构建选项呢?构建选项似乎至少由 Debian 和 Alpine Linux 设置。有什么充分的理由构建没有线程的 Perl 吗?线程化 Perl 的缺点是什么?

最佳答案

因为 Perl 的线程构建比非线程、非多重[2]构建慢 10%[1]


  1. 您的体验可能会有所不同。
  2. 多重性是指在一个程序中支持解释器的多个实例。 -DMULTIPLICITY-Dusethreads 隐含和必需的(因为每个线程都有自己的解释器)。

关于multithreading - 为什么默认情况下没有设置线程 Perl(使用 usethreads)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66285705/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com