Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Utter FUD!

by BrowserUk (Pope)
on Oct 25, 2010 at 08:55 UTC ( #867168=note: print w/replies, xml ) Need Help??


in reply to Re: is ||= threadsafe?
in thread is ||= threadsafe?

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.

Replies are listed 'Best First'.
Re^3: Utter FUD!
by Anonymous Monk on Oct 25, 2010 at 14:56 UTC

    Yeesh, what's with all the hostility?

    See Tye's buried node for a sensible answer. Unfortunate that it wasn't posted at a more visible depth.

      See Tye's buried node

      No point in even looking. It'll just be more uniformed, unfounded FUD based on nothing more than supposition and rumour.

      Yup! Just as I suspected.


      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.

        So, agreeing with you in principle is FUD.

        Duly Noted.

Re^3: Utter FUD!
by ikegami (Pope) on Oct 25, 2010 at 16:42 UTC

    Stop pretending I said it was unsafe.

    The idea is that someone would indicate if it was or not. It would have taken 30s of my time and 30s of theirs.

      Stop pretending I said it was unsafe.

      I'll let others judge for themselves what was implied by what you said.

      Had you asked a question, rather made an ambiguous and highly suggestive statement, we would not be having this discussion.

      someone would indicate if it was or not.

      I had already answered the OP question 1hr 27 minutes before you posted.

        Your answer to the OP has nothing to do with what I posted, so I don't know what your last para is trying to say.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://867168]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2017-12-18 22:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (500 votes). Check out past polls.

    Notices?