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

It hangs on Windows; and will eventually hang everywhere if you add any useful code to the while loops.

As a coding pattern, ikegami's code is broken by design. End of.


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.

Replies are listed 'Best First'.
Re^15: Threads sharing global variable
by Anonymous Monk on Mar 06, 2016 at 15:45 UTC

    It hangs on Windows; and will eventually hang everywhere if you add any useful code to the while loops.
    I asked why it deadlocks. You are saying "it hangs. End of."

    Well, there you go. This is the difference between users and experts. The difference between playing and knowing.

      Well, there you go. This is the difference between users and experts. The difference between playing and knowing.

      How would I know? I don't use linux; and I rarely ever rely upon the broken semantics of condition variables.

      Why would I when there are so many better mechanisms on my platform.

      As for expertise; if you are so expert, why do you need me to tell you about the limitations of your platform; much less expect me to help you debug them.


      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.