Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I use a similar metaphor but with food. I defo prefer yours. Stealing it. Thanks!
-
nibor48775yI like this, except I can't imagine how someone can take all of the paper while you are sitting there
-
@nibor One CPU may wreak more havoc within a blink of an eye than you can repair in your whole life, that's how.
-
Your rants are magical. This belongs in Fast-Nop’s programming explained coffee table book. 👌🏼
-
@ybautista Btw. operating systems: if you have different processes accessing the same addresses in their repective address spaces, then it's like two people using the same stall, but in different floors of the building. :-)
Related Rants
-
codeRetard10devRant; The new reason why I take my phone to the toilet!
-
sak963Misunderstanding is like running ftp server on port 80! Ftp responses for http request! In real life it happen...
-
Godisalie7Sometimes I wish I was allowed to just strangle my colleagues... Example from the 'code base': try: do_...
Toilets and race conditions!
A co-worker asked me what issues multi-threading and shared memory can have. So I explained him that stuff with the lock. He wasn't quite sure whether he got it.
Me: imagine you go to the toilet. You check whether there's enough toilet paper in the stall, and it is. BUT now someone else comes in, does business and uses up all paper. CPUs can do shit very fast, can't they? Yeah and now you're sitting on the bowl, and BAMM out of paper. This wouldn't have happened if you had locked the stall, right?
Him: yeah. And with a single thread?
Me: well if you're alone at home in your appartment, there's no reason to lock the door because there's nobody to interfere.
Him: ah, I see. And if I have two threads, but no shared memory, then it is as if my wife and me are at home with each a toilet of our own, then we don't need to lock either.
Me: exactly!
rant
race condition
toilet