Search code examples
multithreadingperlcompiler-options

How come threaded perl (with usethreads) isn't set by default?


According to the 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.

With the thread implementation being pretty stable, how come it isn't a default build option? The build option seems to be set by at least Debian and Alpine Linux. Is there any good reason to build Perl without threads? What are the downsides to threaded perl?


Solution

  • Because threaded builds of Perl are 10% slower[1] than non-threaded, non-multiplicity[2] builds.


    1. Your experience may vary.
    2. Multiplicity is supporting multiple instances of the interpreter in one program. -DMULTIPLICITY is implied and required by -Dusethreads (since each thread has its own interpreter).