in reply to Re^5: Threads sharing global variable
in thread Threads sharing global variable

For me, it works fine in Windows too.
C:\Users\ikegami>perl a.pl At printer 2 0 At printer 93 0 At printer 94 0 At printer 60 0 At printer 26 0 At printer 83 0 At printer 65 0 At printer 45 0 At printer 8 0 At printer 20 0 At printer 7 0 At printer 47 0 At printer 53 0 At printer 22 0 At printer 26 0 At printer 22 0 At printer 24 0 At printer 51 0 At printer 13 0 At printer 100 0 ...
This is perl 5, version 16, subversion 3 (v5.16.3) built for MSWin32-x +64-multi-thread

Replies are listed 'Best First'.
Re^7: Threads sharing global variable (disingenous)
by BrowserUk (Patriarch) on Mar 09, 2016 at 14:58 UTC

    This is your most disingenuous post to date. (The latest in a very long line.)

    Below is a simple experiment using your exact posted code from Re^2: Threads sharing global variable; that anyone running windows and a few versions of perl installed, can conduct for themselves in around five minutes, and see your dishonesty for themselves.

    This is your code running under This is perl, v5.10.1 built for MSWin32-x64-multi-thread:

    Summary: It produces 287(*) lines of output before hanging. (Varies from run to run; but that's typical.)

    This is your code running under This is perl 5, version 18, subversion 4 (v5.18.4) built for MSWin32-x64-multi-thread:

    Summary: It produces 817* lines of output. (Usually runs a little longer than under 5.10, but of 20 runs this was the most output before hanging.)

    This is your code running under This is perl 5, version 22, subversion 0 (v5.22.0) built for MSWin32-x64-multi-thread:

      The signal can't be missed as long as cond_signal($c) and the cond_wait($c) while !desired_condition(); are only called when you have the lock. That's why it works for your code. That's why it works for my code. There's a bug in your OS (or emulation) otherwise.

      (Stopped test after it produced 6,951,816 lines and 110,673,920 bytes of output)

        The signal can't be missed

        Of course. Ikegami knows better than the rest of the entire world. (At least, he thinks he does!)


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        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". I knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.