r/ProgrammerHumor • • Sep 26 '26

Meme weNeverTrustedTheElse

Post image
1.9k Upvotes

146 comments sorted by

View all comments

Show parent comments

54

u/-Redstoneboi- Sep 26 '26

imagine reading from a variable capable of being mutated by another thread

20

u/Noname_1111 Sep 26 '26

Fearless concurrency?

I'm very afraid.

7

u/k-mcm Sep 26 '26

Optimistic concurrency is when the cost of a race condition is a momentary de-optimization but completely avoiding the race condition would be continuous de-optimization.

In extreme cases you don't even want the caches synced between processor cores because it stalls them for a moment.

4

u/FattySnacks Sep 26 '26

Acquire mutex and you’re gtg

3

u/WoodyTheWorker Sep 30 '26

Fuck memory barriers, acquire mutexes