• Anon (unregistered)

    Due to locking issues the post becomes "FirFirst!st!"

  • Anon (unregistered)

    I regret clicking on a specific word in the article.

  • Oliver Jones (google)

    Time for a WTF or two about devs who don't understand floating point, and other things that should have made them flunk CS201.

  • Dude (unregistered)

    One of my coworkers insisted something like this would work for locking threads. Thankfully, he actually listened when we explained to him why it wouldn't.

  • (nodebb)


  • Da expert (unregistered)


  • (nodebb)

    Well, so long as there's a railing, lamppost, or similar inside the yellow loop, that might actually work to stop someone making off with the front wheel and the handlebars. It doesn't stop someone stealing the saddle and/or the rear wheel and/or the frame, but at least you'll have the handlebars and the front wheel. (Depending on how hard it is to remove the handlebars from the top of the steering column without cutting anything, you might even get to keep the frame.)

    The locking "solution" in the article is even less good than that.

  • Herby (unregistered)

    Sounds to me like the "Lock Ness Monster".

    Sorry, I couldn't resist. You can groan now.

  • codemonkey (unregistered)

    I can never remember how to do this. i always have to go to that stack overflow answer.

    threading is hard

  • siciac (unregistered) in reply to Oliver Jones

    Once they learn how to make monitors work, the next step is always trying to run hundreds of threads doing IO on a single disk, or trying to run 1000 threads that all stack up on a single monitor. :-/

  • cerkiewny (unregistered)

    I have seen similar code, It was introduced to fix some bug. Interestingly it was some sort of stack corruption... And it... did the job!? After a long investigation we found that the useless lock was shifting the values in the stack only to make the bug corrupt some other memory. The bug went away...

    Creating a stack in which 90% of values are only there to be corrupted seems like legit solution to problems. I call the pattern: "meat shield".

  • doubting_poster (unregistered) in reply to cerkiewny


Leave a comment on “Synchronized Threads”

Log In or post as a guest

Replying to comment #484351:

« Return to Article