develooper Front page | perl.perl5.porters | Postings from April 2018

Re: [perl #133021] Removed the word "discouraged" from threads'documentation

Thread Previous | Thread Next
Christian Walde
April 9, 2018 21:01
Re: [perl #133021] Removed the word "discouraged" from threads'documentation
Message ID:
On Mon, 09 Apr 2018 12:37:54 +0200, Dave Mitchell <> wrote:

> Is this based on the idea that the ithreads implementation itself is
> inherently buggy, or that some modules may not be thread-safe.

My current assumption is the latter. However i cannot speculate at all as to whether it might be some of column A or not.

> 2) If one's threaded code randomly craps out due to a 3rd party module
> being non-thread-safe, or supposedly thread-safe but buggy, then that's an
> issue with the third-party module. In principle any programming language
> will struggle with threads if used with a 3rd-party library that isn't
> thread-safe.

This has dangerous assumptions in it:

- Thread safety is not a binary on/off switch. Modules can appear to be thread-safe under some conditions and not be so under others. That's why i called it a heisenbug in my previous email.

- Putting the blame on 3rd party modules is fine for most languages where it's easier to switch to other implementations or roll your own. However this is Perl. The language lives on CPAN, not in the interpreter. Asking someone who just spent hours implementing a parallel web downloader to gradually replace any of the bits they used will not be taken well.

- Very few cpan maintainers know how to do thread-safety. Heck, most don't even practice string/binary safety for filehandles. Most of them are Perl developers first and you're asking them to move at least 2 degrees of separation outside of their zone of comfort. For a lot of modules there's simply a good chance this is not going to happen.

With regards,
Christian Walde

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About