Video Flagged Dead

"Training" video for motocross (thongs NSFW)

swinginpagansays...

Yeah, about that powervote...

I hit the "vote" button like normal, and it turned gold while it was processing my vote, and then it just hung there for a few seconds, during which I went "click? click? click!!!"

Oohahh says I created a race condition. I don't know what that means. Except that it means that I can POWERVOTE!!1111!!!

So yeah, sorry about that. Thanks for fixing it...

oohahhsays...

Or perhaps, "exploited a race condition". That's my sweetie, leet hax0r *and* purveyor of fine feather headdresses.

What's a race condition? Let's look at a real world example, counting attendees at the ballpark.

This ballpark has several entrances, each with a single person counting people as they walk in. Each of those counters has a little handheld computer with a button. The computers are connected wirelessly to a central machine that keeps track of the total for all entrances.

(Did you wonder about counting the people who leave? Congratulations, you get a cookie! We'll skip that, just to keep things simple.)

Ready to write bad counting software now? Whoo, me too! ...the good times just never stop around here. ;-)

So, the central computer can do two things:

1: report on the total number of attendees
2: set the new total number to whatever we say

Each wireless clicker can do just one thing:

1: Ask the central computer for the total number of attendees, add one, and report the new number back

What's the problem? Well, there's a small lag time between when the clicker asks for the total, and when the new total gets back to the central computer.

TWO COUNTERS ENTER, ONLY ONE WILL LEAVE!

Alfred and Bettie both click at the exact same instant
Alfred and Bettie both learn that there are 999 total attendees
Alfred adds one and reports that there are now 1000 total attendees.
Bettie adds one and reports that there are now 1000 total attendees, too.

Whoops? There should be 1001 total attendees, not 1000. We lost one.

Because this is a bug brought on by time, or by when things happen, it's called a "race condition", that is, when two processes run at the same time and assume that nothing will change behind their back.

Send this Article to a Friend



Separate multiple emails with a comma (,); limit 5 recipients






Your email has been sent successfully!

Manage this Video in Your Playlists




notify when someone comments
X

This website uses cookies.

This website uses cookies to improve user experience. By using this website you consent to all cookies in accordance with our Privacy Policy.

I agree
  
Learn More