Comment

Comment by 2bitencryption

Allow me to ask a dumb question:

At the end of the day, how can something that is safely concurrent also be lock-free? At the lowest level, what is the primitive that enforces the safety, if it's not a lock or mutex?

My brain starts to run in cricles when I think of this scenario: two threads trying to write to one piece of data. To do so safely, they need to take turns. Therefore, one has to wait for the other to complete. Therefore, one must acquire a mutually exclusive... hold on, that's a mutex!

Can someone please clear this up for me?

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton