News for hackers. Stuff that matters.
Re:How our users exploited concurrency and how we fixed it by vemv on Friday January 11, 2013 @06:28PM (#5045644)
Really not that much of a subtle bug I'm afraid, the pattern of "mutating the condition itself on success" is error-prone in single-threaded code too.

A good example being asynchronous javascript, where you'd do this to prevent issues like the exposed in the article:

    var some_mutable_condition = false;
    var requested = false;

    if (!some_mutable_condition && !requested){
        requested = true; // ensure one request is performed at most
        $.ajax(/*async code that'll set some_mutable_condition to true*/);
    }
Re:How our users exploited concurrency and how we fixed it by mguterl on Friday January 11, 2013 @06:42PM (#5045699)
Underscore.js has a function called once for this exact purpose.
Re:How our users exploited concurrency and how we fixed it by vemv on Friday January 11, 2013 @06:56PM (#5045754)
Good to know, thank you.