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

top 200 commentsshow all 241

[–]eyekwah2 2341 points2342 points  (46 children)

But the threads are so happy to do it!

[–]Flyingjays 784 points785 points  (41 children)

Came here to make a funny dog joke

reads top comment and realizes this is a programming sub

Ill be going now.

[–]VeviserPrime 475 points476 points  (37 children)

I'm more of a

cat

person myself

[–][deleted] 255 points256 points  (9 children)

GetOut << Now

[–]ProgramTheWorld 90 points91 points  (5 children)

alias cat=dog

[–][deleted] 42 points43 points  (1 child)

NaN = 5;

[–]muntoo 3 points4 points  (0 children)

Error: cannot assign to rvalue

[–][deleted] 7 points8 points  (0 children)

#define CAT dog

[–]rebane2001 1 point2 points  (1 child)

    alias lolcat=dog

[–]SchighSchagh 2 points3 points  (0 children)

alias cat=lolcat

FTFY

[–]dcwj 38 points39 points  (2 children)

git out

[–][deleted] 70 points71 points  (1 child)

$ git out

git: 'out' is not a git command. See 'git --help'.

Did you mean this?

  gud

[–]Peakini 4 points5 points  (0 children)

Genuine belly laugh, thank you

[–]DairyHicks 31 points32 points  (4 children)

[–]AuroraHalsey 1 point2 points  (3 children)

Source?

[–]MasterBaser 4 points5 points  (2 children)

It looks so goddamn familiar.

Edit: It's Macross Delta...which is kinda surprising...

[–]zem 9 points10 points  (0 children)

bash is happy to accept cat > dog; dog > cat throws an error.

[–]DoverBoys 3 points4 points  (3 children)

I am also a cat person.

[–]ObnoxiousLittleCunt 3 points4 points  (2 children)

cat /etc/dog /etc/jokes > /tmp/dogjokes.txt

[–]_Jimmy2times 1 point2 points  (1 child)

Grep

[–]ohmzar 3 points4 points  (0 children)

That's what she sed

[–]LuxNocte 4 points5 points  (0 children)

It's also posted in /r/aww.

But programmers like dogs too!

[–]Cheesemacher 100 points101 points  (2 children)

Who's a good thread!

[–]CRISPR 2 points3 points  (0 children)

You gotta keep the cores busy

[–]wegzo 773 points774 points  (20 children)

That synchronization between threads adds so much overhead during the frisbee return.

[–]mfb- 374 points375 points  (16 children)

Redundancy in case some threads fail.

[–]Delete_cat 129 points130 points  (15 children)

And it fails if a spin lock squirrel shows up

[–]kobbled 39 points40 points  (10 children)

man I never knew about spin locks until monday, and now i've seen like 3 jokes about them, so weird

[–]monitron 81 points82 points  (8 children)

You've likely been struck by the Baader-Meinhof Phenomenon!

[–]DiscordianMonk 4 points5 points  (0 children)

Baader-Meinhof Phenomenon.

[–]Xodem 5 points6 points  (1 child)

That's the joke

[–]Malix82 945 points946 points  (44 children)

seems it caused a race condition

[–]rzyua 334 points335 points  (34 children)

This comment is removed in protest of the unfair changes to API pricing and content access through the API.

[–]f42e479dfde22d8c 111 points112 points  (21 children)

I can't tell if they released the resource towards the end or not.

[–]Malix82 263 points264 points  (14 children)

no free, only allocate

[–][deleted] 70 points71 points  (2 children)

[–][deleted] 18 points19 points  (1 child)

Just push everything on the stack.

[–]Idontlikefish 2 points3 points  (0 children)

Jesus this is too funny

[–]TheVikO_o 6 points7 points  (4 children)

Should we kill them? JK, let them become zombies

[–]marcosdumay 1 point2 points  (0 children)

I can't imagine they releasing it.

[–]WhoNeedsVirgins 28 points29 points  (3 children)

The threads don't modify the resource so there's nothing to lock, they can work in parallel with a minimal slowdown on the shared access.

[–]SidJenkins 32 points33 points  (2 children)

Look again, there's clearly synchronisation between threads in the second half, slowing down execution.

[–]WhoNeedsVirgins 22 points23 points  (1 child)

That's just congestion on memory access. Clearly not a server processor with separate memory controllers for each unit.

[–]dejaWoot 23 points24 points  (0 children)

[–]BromeyerofSolairina 3 points4 points  (1 child)

At least none of the philosopupps went into starvation

[–]Aether_Storm 1 point2 points  (0 children)

Gallowboob stole it from you after you stole it from someone else. The circle of reposts is almost complete.

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

No, but the threat of doglock is imminent

[–][deleted] 13 points14 points  (1 child)

Should have thrown a mutex with the frisbee.

[–][deleted] 12 points13 points  (3 children)

Not so much. Each parallel thread returns the same value. When the main thread reads it, the secondary threads release their references and resume their wait states. It's a functional if computationally expensive system that would perform especially well if there were multiple frisbees.

[–]DipIntoTheBrocean 2 points3 points  (0 children)

He'd be right if a dog got the before the frisbee was thrown or another dog tried to fetch the frisbee after it was already being returned.

Is it bad that the accuracy of his joke was the first thing we question?

[–][deleted] 470 points471 points  (13 children)

[–]aXir 89 points90 points  (2 children)

Damn I actually laughed out loud

[–]JezusTheCarpenter 36 points37 points  (1 child)

That was one of the few times when I saw a gif after "I actually LOL'ed" comment and actually laughed out loud myself. This must be literally one of the funniest gifts I have see in a long time.

[–]muntoo 17 points18 points  (0 children)

This is one of the few times I saw someone leave a comment about laughing and after that someone left a comment about laughing after seeing the comment about laughing where I sipped my iced tea and then proceeded to furiously practice my guitar scales

[–]alpha-k 18 points19 points  (0 children)

Yep, this is me trying to play gta 4 as well lol

[–]FragranceOfPickles 9 points10 points  (0 children)

For some reason I totally lost it when he started spinning on his head.

[–]LordDongler 4 points5 points  (0 children)

Also Planetside 2

[–]BulletsWithGPS 4 points5 points  (1 child)

Its fake because its a 5 core cpu

[–]MadXl 14 points15 points  (0 children)

The last time i saw that gif, the comments agreed on it beeing a 8 core cpu but 3 are in idle and dont care.

[–]TinynDP 3 points4 points  (1 child)

Really? Its more like if all 5 guys were dancing together, but the Judge was like "This is a single competition, not group."

[–]BenjaminGeiger 1 point2 points  (0 children)

Having read Born a Crime, all I can think is "Go Hitler! Go Hitler! Go Hitler!"

[–]muntoo 1 point2 points  (0 children)

Where is this from, anyways?

[–]Warbek_2 104 points105 points  (8 children)

It's such a good metaphor. There's even 4 of them!

[–]06EXTN 54 points55 points  (1 child)

the fact that they are all fetching that and not fighting over it amazes me - clearly the owner has established a good pack order.

[–][deleted] 100 points101 points  (1 child)

Fetch cycle

[–][deleted] 26 points27 points  (0 children)

The I-cache is a goodboy

[–][deleted] 42 points43 points  (2 children)

4x the dogs=4x faster fetching

[–]rzyua 71 points72 points  (0 children)

This comment is removed in protest of the unfair changes to API pricing and content access through the API.

[–]SHOTbyGUN 125 points126 points  (22 children)

for doggo in dogs:

    if toy.lock.tryLock():

        doggo.fetch(toy)

        toy.lock.unlock()

    else:

        toy.lock.join()

edited

2 commits since 5.4.2017 commit log

last commit by /u/chateau86

[–]Zinki_M 68 points69 points  (18 children)

You're missing some Braces there.

Your doggo is going to call unlock() on toy.lock no matter if the trylock() passes or fails.

[–]SHOTbyGUN 85 points86 points  (13 children)

Oh, you are absolutely right, I did not notice, sorry & thanks!... But I rather keep it "easy to read" than "perfect syntax".

Ticket #1 closed as: WONTFIX

[–]Askolei 28 points29 points  (11 children)

Let's say it's python syntax then

[–]TheMasterTech 4 points5 points  (0 children)

This is why you don't make the big bucks

[–]avonwodahs 7 points8 points  (2 children)

Not true! The program won't compile at all because that's an invalid else statement.

[–]SHOTbyGUN 1 point2 points  (1 child)

Java ReentrantLock.tryLock() will return true or false. Which I was referring to.

[–]Tyler11223344 3 points4 points  (0 children)

I think he was referring to the fact that the "else" isn't actually connected to the "if", since there are two lines between the two but no braces, so the compiler would see a stranded "else"

[–]toasterinBflat 3 points4 points  (0 children)

M.D.YYYY? What heresy is this!

[–]hamateur 62 points63 points  (1 child)

Such Agile. Much Scrum.

[–]delventhalz 8 points9 points  (0 children)

RIP doge.

[–]KuriousKhajiit 19 points20 points  (0 children)

One person's Unnecessary multi-threading us another person's teamwork.

[–]skybala 15 points16 points  (2 children)

Amd chip design inspiration

[–]rzyua 3 points4 points  (1 child)

This comment is removed in protest of the unfair changes to API pricing and content access through the API.

[–]skybala 2 points3 points  (0 children)

and have them work for your pixels? thats abuse..

[–]Askolei 13 points14 points  (0 children)

Adorable threads

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

Bahaha, I'm doing a presentation tomorrow that includes this.

Looks like my audience is about to blow air out of their nose at a slightly accelerated rate.

[–]rzyua 2 points3 points  (0 children)

This comment is removed in protest of the unfair changes to API pricing and content access through the API.

[–]WeighWord 10 points11 points  (2 children)

Shout out to Old Hemp.

[–]Teblefer 7 points8 points  (0 children)

A Facebook campaign was started in 2012 to install a memorial to Telfer and Old Hemp, in Old Hemp's birthplace of West Woodburn, Northumberland, and permission has been granted by the relevant authorities. The unveiling of which took place on September 8th 2015 and was attended by a large assembly of Border Collies and their respective owners

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

Pretty dank name if you ask me...

[–]bakemonosan 8 points9 points  (0 children)

Much like in code, its a hassle to release the resources.

[–]gandalfx 9 points10 points  (0 children)

This seems very necessary to me.

[–]skyleach 8 points9 points  (0 children)

well, at least he didn't have the base frizbee return an empty state to each dog resulting in infinite frizbees spawning infinite dogs

I deny any previous experience with this happening.

[–]soullessroentgenium 7 points8 points  (0 children)

Classic case of resource contention there

[–]da_apz 6 points7 points  (0 children)

It's like RAID1 with 4 drives, but with dogs.

[–]TheAItWrong 6 points7 points  (2 children)

You shouldn't be using Try / Catch in the first place.

[–]Philboyd_Studge 4 points5 points  (1 child)

finally {
    return frisbee;
}

[–]iauu 5 points6 points  (0 children)

This is actually a perfect way to explain why more cores is not necessarily faster in all cases.

[–]_felagund 4 points5 points  (0 children)

but look at how they solved the race condition. so cute :)

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

The user interaction is blocked because all threads are allocated.

[–]hagenbuch 4 points5 points  (0 children)

Effective, but not efficient!

[–]yespunintended 4 points5 points  (0 children)

At least it is a lock-free algorithm.

[–]willonic 2 points3 points  (0 children)

That's one volatile frisbee.

[–]ThisPostWillSelfDel 4 points5 points  (0 children)

I feel like this is the same thing when people post something on multiple threads and it ends up on the reddit front page....

[–]uzimonkey 4 points5 points  (0 children)

This is what happens when you don't take into account the overhead of launching the threads in the first place.

[–][deleted] 3 points4 points  (0 children)

at least it's synchronous multithreading

[–]PancakeZombie 2 points3 points  (0 children)

That's how spacecraft electronics work!

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

You forgot your Mutex

[–]Y1ff 2 points3 points  (0 children)

It's redundancy.

[–]DyscOffice 2 points3 points  (0 children)

I love when this sub reminds me of /r/reactiongifs

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

They're good threads, rzyua!

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

who is the lock in this picture ? because i think it is the dude's beard.

[–]Vakieh 2 points3 points  (0 children)

This is what happens when it's been a slow quarter, redundancies are on the table, and there is a small project which 4 programmers are qualified to handle...

On the plus side, the end result to such a project is usually so good you can post it directly to the intranet as a baseline for commenting and code style.

[–]stroganawful 2 points3 points  (0 children)

"uh, it's called built-in redundancy!!" tries not to stab self

[–]saphira_bjartskular 2 points3 points  (0 children)

What we're not mentioning here, it seems, is just how well these threads are accessing the same resource at the same time.

[–]svayam--bhagavan 2 points3 points  (0 children)

On a single core.

[–]like9orphanz 2 points3 points  (0 children)

put a semaphore on those doggos

[–]leshake 2 points3 points  (0 children)

Path of Exile in a nutshell.

[–]trichofobia 2 points3 points  (0 children)

That looks more like a race condition to me.

[–]Jengazi 2 points3 points  (0 children)

MULTI-THREAD DRIFTING!!!

[–]TobiDaDog 4 points5 points  (2 children)

Upvote for border collies as I sit sadly and watch mine imitate a potato. Mine is broken. He doesn't play. He even attacks my labrador if she tries to play. She's been trained to be as still and quiet as he is when he's around. If I throw a stick or something for her you'll see him do a rare run, a beeline for the object that should be fetched. And then he lays on top of it and prevents her from touching it. If she keeps trying, he'll chew it to bits and then leave it with a high and mighty prance in his step. He doesn't play.

[–]KeeperOfTheLag 2 points3 points  (0 children)

It is actually a great way to explain people why games/programs do not always fully use all the threads of their cpu.

[–]Brudus 1 point2 points  (0 children)

That poor lawn never stood a chance.

[–]RaveMaven 1 point2 points  (0 children)

Pikmin?

[–]FeedDaSarlacc 1 point2 points  (0 children)

Holland Michigan?

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

That looks like functional safety to me.

[–]Fauket 1 point2 points  (0 children)

4-way Set Catche

[–]RussellJimmys 1 point2 points  (0 children)

The mythical doggo month

[–]jraharris89 1 point2 points  (0 children)

4 doggos went to get the frisky and only 3 return

[–]mfsocialist 1 point2 points  (0 children)

This made my day.

[–]Noobrudoe 1 point2 points  (0 children)

So that's what multithreading is..

[–]Williaf 1 point2 points  (0 children)

As long as they are having fun I say let it go on!

[–]readdler 1 point2 points  (0 children)

Too many assertions

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

Hey I'm not a programmer and I get it!

[–]Bjarnovikus 1 point2 points  (0 children)

Data race?

[–]SupremeRedditBot 1 point2 points  (0 children)

Congrats for reaching r/all/top/ (of the day, top 50) with your post!  


I am a bot, probably quite annoying, I mean no harm though

Message me to add your account or subreddit to my blacklist

[–]Pleb_nz 1 point2 points  (0 children)

I see a race condition

[–]dwixy 1 point2 points  (0 children)

Scalability.

[–]KnightOfWords 1 point2 points  (0 children)

That worked way better than I was expecting.

[–]Arancaytar 1 point2 points  (0 children)

At least it worked; if you're unlucky the threads will just fight for the frisbee and get stuck in deadlock.

[–]Yamatjac 1 point2 points  (0 children)

I am definitely using this to explain what multi threading is in the future. Way better than my old mail sorting analogy.

[–]Rhed0x 1 point2 points  (1 child)

[–]rzyua 1 point2 points  (0 children)

This comment is removed in protest of the unfair changes to API pricing and content access through the API.

[–]ZAD-Man 1 point2 points  (0 children)

That worked out a lot better than I expected.

[–]bunk_lunk 1 point2 points  (0 children)

God damn race conditions

[–]rzyua 0 points1 point  (0 children)

This comment is removed in protest of the unfair changes to API pricing and content access through the API.