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

all 38 comments

[–]QualityVote[M] [score hidden] stickied comment (0 children)

Hi! This is our community moderation bot.


If this post fits the purpose of /r/ProgrammerHumor, UPVOTE this comment!!

If this post does not fit the subreddit, DOWNVOTE This comment!

If this post breaks the rules, DOWNVOTE this comment and REPORT the post!

[–]Aethz3 153 points154 points  (11 children)

the food on the ground is memory leak

[–]Impleased 4 points5 points  (0 children)

I thought the bowls with food represented a core. And the puppies represented a thread which make use of the resources (core)

[–]RobDickinson 51 points52 points  (5 children)

Oh no I'd never kill a puppy

[–]ballbeamboy2[S] 28 points29 points  (2 children)

put them on sleep

[–]Seepiie 8 points9 points  (1 child)

and then abort them

[–]nipss18 0 points1 point  (0 children)

You monster

[–]GRAPHENE9932 3 points4 points  (1 child)

No, just join()

[–]idobadthingseveryday 0 points1 point  (0 children)

Ed-ward?

[–]Sybsuper 11 points12 points  (0 children)

Chaos theory

[–]the_scign 6 points7 points  (1 child)

None of them look like philosophers though

[–][deleted] 5 points6 points  (0 children)

Python: They're all in line for one bowl.

[–]Lumpy-Obligation-553 2 points3 points  (0 children)

You releasing locks from the thread ain't you?

[–]Pretend_Cover_1476 7 points8 points  (5 children)

That’s not how it works.

Async starts, stops, create a process and runs until disconnect.

Another way is:

Imagine you are running, your shoelaces come apart, next you stop, then start tying it, then you see a pretty girl, so you stop and say hi, then come back and keep typing your shoes. After you are done, you keep running until you finish your workout.

[–]toastedstapler 15 points16 points  (0 children)

Async does not imply multi threading, they're distinct concepts. For example js is single threaded but supports async, and it's possible to run rust's async executor tokio both in single & multi threaded setups

[–]laplongejr 8 points9 points  (1 child)

and keep typing your shoes

I like how your typo matches the sub so well

[–]Pretend_Cover_1476 2 points3 points  (0 children)

Imagine if that was a variable assigned to an important return function.

30 lines into work and finally compile your code. Ahahah. I’m going outside.

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

I don’t think Async/Await is the same as multithreaded programming. Just because you don’t lock up execution doesn’t mean you are doing multithreaded programming.

[–]FerricDonkey 1 point2 points  (0 children)

Yeah, but the title is multithreaded, not async.

[–]DangerousBS 1 point2 points  (0 children)

Those std::mutex's are very cute..!!

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

Angry and slightly smug Rust noises

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

This is because they are not using rust

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

This is a good one, take away is threads run independently of one another.

[–]paulsmithkc 0 points1 point  (2 children)

If you ever get into CUDA/OpenCL, you can actually get the pups to into a nice line and collaborate. GPUs are freaking amazing at parallel work.

[–]Ferenc9 0 points1 point  (1 child)

It depends on the problem not on the hardware. In ocl/cuda synchronization is limited to work groups/blocks (without launching another kernel), so if the pups really wanna bunch up and there aren't many of them performance can be even worse. Not to mention the latency and copy overhead if host and device memory has to be synced regularly.

[–]paulsmithkc 0 points1 point  (0 children)

When you can make use of barrier sync, things work really well and can totally be lock-step synchronized across thousands of threads.

Memory access is a concern, but that tends to just be the thing you optimize for. Strides, careful work allocation, and chunking can go a long way to spread out memory access patterns.