Admittedly, I have only waited roughly an hour for this to run, but that is sufficient for 100 threads to explore the possibilities of each your speculative modes of failure, for 100 million plus iterations each. (Ignoring all the other threaded code I've ever written that could have done so)

I consider that a pretty conclusive demonstration that you're talking out your a the top of your head.

Of course you could have tried this trivial test of your speculations yourself, in the same minimal amount of time, before posting such FUD, but that wouldn't meet your apparent motivations.

#! perl -slw use strict; use threads stack_size => 4096; use threads::shared; open STDOUT, '>', 'nul' or die; my $shared1 :shared = 1; my $shared2 :shared = 2; my $shared3 :shared = 3; my @counts :shared = (0)x3; sub FUD1 { ## According to ikegami ## $shared = "abc"; # Can cause scalar type conversion ## leading to [867132|a segfault] while( 1 ) { my $chance = rand; $shared1 = $chance < 0.333333333 ? "fred$chance" : $chance < 0.666666666 ? $chance : int( $chance * 100 ); lock @counts; ++$counts[0]; } } sub FUD2 { ## According to ikegami ## [867127|my $ref = \$shared; # Increments ref count] ## leading to [867132|premature deallocation] while( 1 ) { { my $ref = \$shared2; } die unless defined $shared2; lock @counts; ++$counts[1]; } } sub FUD3 { ## According to ikegami ## [867127|print "$shared\n"; # Implicit type conversion] ## leading to [867132|a segfault] while( 1 ) { print "$shared3"; ++$shared3; lock @counts; ++$counts[2]; } } async( \&FUD1 )->detach for 1 .. 100; async( \&FUD2 )->detach for 1 .. 100; async( \&FUD3 )->detach for 1 .. 100; printf STDERR "\r@counts" while sleep 1; __END__ C:\test>ikeFUD1.pl 108788021 167537823 101758175 Terminating on signal SIGINT(2)

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

In reply to Re^2: Utter FUD! by BrowserUk
in thread is ||= threadsafe? by perl-diddler

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.