Comment

Comment by twmb

This is a decent reminder blog post about something that is obvious on the surface, but subtle when you forget to think about it and make a mistake.

I've found that thinking of a lock as something you don't want to hold goes a long way. The point of locks is to release them.

Jeff Preshing has a good series on locks and concurrency. This[0] post (potentially with an extra dozen I read in the same sitting) is the one that really changed how I thought about locks: before I read it, I was very into lock freedom at every opportunity.

0: https://preshing.com/20111118/locks-arent-slow-lock-contenti...

parent twmb 7 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton