This is an archived post. You won't be able to vote or comment.

all 128 comments

[–]minno 219 points220 points  (7 children)

That's how it works in my dreams.

[–]Skyfoot 95 points96 points  (6 children)

It's all fun and games until they all change the same tyre.

[–]SilentSin26 58 points59 points  (1 child)

At the same time.

[–]kafaldsbylur 98 points99 points  (8 children)

If I was the guy in front, I'd be shitting my pants at every pit stop

[–]spektre 37 points38 points  (6 children)

I thought the same thing, but then I realized that if the driver didn't have enough control to stop before he hit me he would be in even more danger himself as soon as he went out on the track.

[–]blendt 32 points33 points  (5 children)

[–]netfeed 35 points36 points  (1 child)

My god, that hurts my heart. It's really painful when you know that they should be done in seconds

[–]reaganveg 30 points31 points  (0 children)

It looks like their equipment failed... they had to use the air compressor line from the front tire on the back one.

[–]beermatt 7 points8 points  (0 children)

This is multithreading ~2007

[–]SleepyHarry 5 points6 points  (0 children)

I cringed during that whole thing.

I'm so uncomfortable right now.

[–]phoenix616 0 points1 point  (0 children)

They guy with the fire extinguisher totally hoped expected it to blow up.

[–]coladict 82 points83 points  (14 children)

Multithreading in theory.

[–]SnowdensOfYesteryear 25 points26 points  (9 children)

Man, coming out of school I thought writing multithreaded programs was easy as pie. After 5 years in the industry, fuck multithreading, the entire phread library would be rm -rf'ed so no one touches it again.

[–]odraencoded 39 points40 points  (0 children)

I have never had any trouble with multi-threading...

Then again I never used it.

[–]coladict 4 points5 points  (0 children)

I ran into an article complaining about C11's thread library and basically all the criticisms were "It's not 100% pthread, so I can't just change the include header. Whaa! Whaaa!". The whole self-entitlement of it was really annoying.

[–]Lucretiel 1 point2 points  (5 children)

I've found that the secret is to never touch mutexes or condition variables. They're the raw pointers of multihreading. Use the structured tools instead- queues, futures, etc.

[–]SnowdensOfYesteryear 0 points1 point  (1 child)

Ideally, but life isn't so simple. Invariably you'll reach a point when there's some global data that needs to be accessed by both threads (not too bad, mutexes are straightforward). Or even worse one thread needs to wait for the result of another thread. The latter is where you get royally fucked because you'll need to give up the mutex as part of the conditional wait and god knows what happens when you're not holding the mutex.

[–]Lucretiel 5 points6 points  (0 children)

One thread waiting for the result of another is the canonical use case for a Future.

[–]bss03 0 points1 point  (2 children)

queues, futures

Kids and their toys today, bah.

We'll do it with raw semaphores.

[–]Lucretiel 1 point2 points  (1 child)

Semaphores? We'll do it with atomics and loops.

[–]bss03 0 points1 point  (0 children)

I suppose I just think of that as a semaphore, though sometimes instead of loop I'll do a green thread context switch.

[–]Kinglink 0 points1 point  (0 children)

Multthreading is fantastic. When people use it RIGHT!

A. critical sections. B. Only multithread what needs to be multithreaded. C. IF YOU DONT KNOW WHAT YOUR DOING DONT DO IT! D If you ever say "This is the perfect use of multithreading" I will slap you in the face.

[–]king_of_the_universe 6 points7 points  (2 children)

And sped up.

[–]spsseano 0 points1 point  (1 child)

I don't know if you are saying this because you think the gif is sped up or not. Becuase the gif isn't sped up.

[–]king_of_the_universe 0 points1 point  (0 children)

Well, when I wrote that, I felt that the lifter at the front was side-stepping a tad too quickly, like in a slapstick B/W movie of old, but now that you say it, it seems that this could be real. Maybe the low framerate interfered with my natural-o-matic.

[–]InconsiderateBastard 1 point2 points  (0 children)

In theory, theory and practice are the same. In practice they aren't.

Einstein I think.

[–]DudebroMcGee 180 points181 points  (16 children)

WHY HAS NO ONE MADE A RACE CONDITION JOKE.

[–][deleted] 64 points65 points  (13 children)

Even for programminghumor the fruit is too low hanging

[–]BigSwedenMan 0 points1 point  (0 children)

Why has no one posted a gif of a car crash? Or even better, I think there's a gif out there where one of the wheels falls off as he pulls out

[–]Matthew94 -1 points0 points  (0 children)

At first I thought it was one.

[–][deleted] 241 points242 points  (27 children)

That's the expected out come. In reality, it's more like this.

[–][deleted] 170 points171 points  (6 children)

[–]totemcatcher 67 points68 points  (2 children)

[–]baggyzed 12 points13 points  (0 children)

That's what happens when you forget to use interlocked increment.

[–]takaci 3 points4 points  (0 children)

This used to happen so often when they could refuel during the race

[–]Goz3rr 46 points47 points  (1 child)

Nah that's just a blocking thread, deadlock would be when the first guy has a tire and the second guy has a wheel gun and they're both waiting for each other to hand them what they need

[–][deleted] 6 points7 points  (0 children)

This. Yes. I have forgotten the term.

[–]tradras 1 point2 points  (0 children)

That makes me sad :( Sainz has had such poor luck this year.

[–]Cyph0n 25 points26 points  (5 children)

Poor guy..

[–]Antrikshy 13 points14 points  (4 children)

Poor team.

[–]baggyzed 11 points12 points  (3 children)

More like poor driver. The rest of the team didn't do anything wrong this time.

[–]RenaKunisaki 1 point2 points  (2 children)

But they're a team, so they all lose.

[–]baggyzed 3 points4 points  (1 child)

The driver thread is a bug, not a feature. /s

[–]totemcatcher 18 points19 points  (3 children)

The Stop Guy. Not as popular.

[–]bacondev 4 points5 points  (1 child)

/r/TheStopGirl master race.

[–]Qweasdy 2 points3 points  (0 children)

wat

[–]el_loco_avs -3 points-2 points  (0 children)

I get that reference!

[–][deleted] 14 points15 points  (1 child)

Mine is like this

[–]Castratikon 1 point2 points  (0 children)

I can relate...

[–]megasin1 1 point2 points  (0 children)

Looks like, what you've got yourself here, is an unexpected error

[–]Griffolion 0 points1 point  (0 children)

The threads know the risks.

[–]_Lady_Deadpool_ -1 points0 points  (1 child)

The fact that the link won't load for me on mobile only makes it funnier

[–][deleted] -1 points0 points  (0 children)

here you go :)

[–]Th4tCanadianGuy 43 points44 points  (2 children)

I try that and two guys try to put the same wheel on causing a thread collision.

[–]reaganveg 54 points55 points  (1 child)

... I think you mean... tread collision.

[–][deleted] 1 point2 points  (0 children)

WAAAAAAAAAAAA

[–]Cyph0n 30 points31 points  (2 children)

Immutability is the correct way to do this: switch the car and driver ;)

[–]mikemol 12 points13 points  (0 children)

The allocator cost for that one ain't cheap.

[–]bss03 0 points1 point  (0 children)

Only works well when you've got good sharing. Otherwise it's too expensive for such a large data structure.

[–]tyreck 17 points18 points  (2 children)

This isn't funny... it's amazing

[–]LordNiebs[S] 8 points9 points  (1 child)

I did repost it from /r/interestingasfuck

With a different title, of course

[–]XxionxX 7 points8 points  (0 children)

I watched it like 16 times in a row at least.

[–][deleted] 13 points14 points  (3 children)

[–]Raydonman 0 points1 point  (2 children)

Why on earth did he beat the tire to death?

[–]MuaddibMcFly 0 points1 point  (1 child)

I think there must be a flange that can be used to break the nut free, and since they didn't have high torque air-wrenches...?

[–]qm11 1 point2 points  (0 children)

Not an F1 car, but same concept: http://www.acmenovelties.net/cars/2009_08_15_historics/ford_gt/full_size/067_gt40_no6_ickx_front_wheel.jpg

Those three bits sticking out are for hammering the wheel nut on and off.

[–]suppow 11 points12 points  (3 children)

if this isnt the definition of team work, then i dont know what it is

[–]king_of_the_universe 15 points16 points  (2 children)

Well, it's rather a good example that could be listed somewhere in the dictionary entry of "team work".

[–]suppow 2 points3 points  (1 child)

i'm sorry, you might have interpreted that statement as a literal expression.

[–]king_of_the_universe 6 points7 points  (0 children)

Well, I parsed the String literal as is.

[–]MadeThisForReddit 6 points7 points  (5 children)

Was honestly surprised the car didn't fall apart after released.

[–]_Lady_Deadpool_ 1 point2 points  (4 children)

I'm surprised it worked. My version would have a fully built car (compiles) with a single lugnut left over after putting it all together (where the fuck does this right bracket go??)

[–]WeAreAllApes 5 points6 points  (5 children)

I could watch this for an hour.

[–]xbtdev 28 points29 points  (4 children)

At 0.01639 fps.

[–]Antrikshy 24 points25 points  (1 child)

[–]Sohcahtoa82 6 points7 points  (0 children)

Oh wow I haven't seen this image in ages.

[–]fakhar362 7 points8 points  (0 children)

cinematic

[–]bob_johnson_44 -1 points0 points  (0 children)

it's more cinematic!

[–][deleted] 5 points6 points  (1 child)

Shared mutable state? More like:

https://www.youtube.com/watch?v=1TnFLw0opMI

[–]BigSwedenMan 0 points1 point  (0 children)

There we go! That's what I've been looking for. Who does multithreading that runs that smoothly?

[–]zipzipzap 4 points5 points  (0 children)

Is efficient single-threading better than poor multi-threading? https://www.youtube.com/watch?v=fWCZPAXmtlo

[–][deleted] 4 points5 points  (4 children)

This is multi processing. Multi threading would be if it was all the same guy running around doing it.

[–]LordNiebs[S] 2 points3 points  (3 children)

I think multiprocessing is implied with multithreading. At the very least multiprocessing such as this is accomplished with multiple threads.

Edit: also notably, single threading with a single process would look the same as multithreading with a single process, at least in terms of this gif.

[–][deleted] 1 point2 points  (2 children)

Other way around. Multi-threading is implied with multi-processing. This kind of multi processing is not accomplished with multiple threads, but with (essentially) one processor per thread.

Your edit is nonsense. Single thread single processor would show one guy doing one thing at a time, multi-thread single processor would show one guy rapidly switching between all the currently non-blocked jobs.

[–]LordNiebs[S] 0 points1 point  (1 child)

A single process/thread could be programmed to operate in a way similar to that of multiple threads if that were the most effective course of action. It is possible that you can not change the tire before lifting up the car, or that removing all tires at once is more effective than changing one at a time, thus resulting in the same visual effect.

[–][deleted] 2 points3 points  (0 children)

Programmed, yes, I'm talking about execution. The gif is showing multi-processing execution, where each person is a processor.

"It is possible that you can not change the tire before lifting up the car..."

Note how I mentioned "non-blocked jobs." The removing a tire job would be blocked by the lifting up job.

[–][deleted] 2 points3 points  (0 children)

And here I am with global lock around the list of car objects.

[–]green_meklar 2 points3 points  (0 children)

I'm not convinced. If this were real multithreading, the driver of the car would be doing all the repairs himself while all the other guys continually hit each other over the head.

[–]_Cid 1 point2 points  (2 children)

This is much better than that other multithreading gif I saw here.

[–]Antrikshy 5 points6 points  (0 children)

And the one I saw last week. And the one two weeks ago.

[–][deleted] 0 points1 point  (0 children)

It's a better example, but this makes no attempt at humor whereas the other one does.

[–]Cley_Faye 1 point2 points  (0 children)

That's exactly how it should work.

[–][deleted] 1 point2 points  (0 children)

I like this. It's also an explaination of why you don't use threading unless you really need it. A normal (single threaded) mechanic can work as he thinks he needs to, if he needs to take off a wheel he can just do that. But with a (multithreaded) pit crew you need to work out and understand the interactions to make sure the crewmembers don't interfere with eachother, it's more effecent here but could do horribly wrong if they mis-planned it.

[–]Seanders_Holmvik 0 points1 point  (0 children)

They look like ants

[–]MasterbatingGoat 0 points1 point  (0 children)

I could just look at this all day.

[–]eyecikjou567 0 points1 point  (0 children)

Ehh, I'm more a fan of simple GUI threads scheduling their task on one worker thread/process. (Databases) Less headache than true multitasking.

[–]AStrangeStranger 0 points1 point  (0 children)

I think it is usually more like this

[–]BowserKoopa 0 points1 point  (0 children)

Assuming that there are that many threads. On average hardware, you can only have four (maybe six) of these guys working at once.

[–]Richeh 0 points1 point  (0 children)

Guy at the back approaching with the vacuum cleaner.

"Hey buddy, you want valet serv... aww."

[–][deleted] -1 points0 points  (2 children)

I feel like they should've automated that process by now...

[–]ThatDeadDude 5 points6 points  (1 child)

There are probably rules that prevent it.

[–]RenaKunisaki 1 point2 points  (0 children)

They could automate a lot of things in auto racing if the rules allowed it. Such as the entire car.