On Sun, Nov 25, 2018 at 09:32:33PM -0800, Philip Guenther wrote: > On Sun, Nov 25, 2018 at 1:57 AM 岡本健二 <[email protected]> wrote: > > > I have to use thread on the perl5 of OpenBSD 6.4. > > However, it was disabled on the distribution. > > > > Hmm, is this something that worked in previous releases, or is something > that you've only tried in OpenBSD 6.4? > > Off-hand, it's still disabled by default in the Configure script that perl > people ship, and I don't see anything in the OpenBSD bits to override their > choice.
One of the main reasons is that the "use of interpreter-based threads in perl is officially discouraged" and has been unofficially discouraged for a lot longer. http://perldoc.perl.org/threads.html#WARNING My understanding of the reason it is discouraged is that the threading mechanism in perl does not lend itself to correct code and you're probably better off doing something simpler and getting nearly as good results using another mechanism. > > I tried to make the thread active to recompile the perl5 with -Dusethreads, > > which led me to many test fails. > > > > Were there tests that failed with -Dusethreads that passed when that wasn't > used? If so, which, and what was their output? The perl test suite does not like to run in the OpenBSD source tree, I don't recall why off the top of my head, just that it doesn't. If you had failures that are different than you get without enabling threads, that might be interesting to diagnose. > To put it another way: if you're suggesting that we build the base perl > with -Dusethreads, what are the consequences of that? Test failures? > Bigger binary? pkg_add is slower? It does make perl anecdotally 10% slower overall (as I recall) for non threaded operations. Obviously that depends on the workload, but since we don't use them, making pkg_add and other things that use perl faster seems more useful. http://perldoc.perl.org/perlthrtut.html#Performance-considerations > Why the thread function was disabled in this release? > > Is it security reason? > > > > Upstream has it off by default, nothing so far has needed it, and it makes > things slower (or at least that's why upstream says). Why would we enable > it? See above for more reasoning and you might look at p5-Coro if you really need threads, I haven't had a need for them but have heard they work better than the core implementation. https://metacpan.org/pod/Coro l8rZ, -- andrew - http://afresh1.com People who invent random theories which only defend the vendor must have been beaten as children. Beaten with sticks. At least, that's my theory. -- Theo De Raadt

