Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My understanding was that a lock free algorithm could still wait for an unbounded time, and what you're referring to are called wait free algorithms.


You're right, but much depends on how much performance you need and how critical your realtime performance is. A lock-free algorithm may retry, but it will likely only retry once or twice. Your running time on any given operation may occasionally double or triple, but it won't hit you with six order of magnitudes like might happen with a mutex if it's contended and the thread that owns a lock takes a page fault or something.

I'd probably want to go wait-free if I was writing software for a Mars lander, but lock-free is good enough for consumer audio tasks, where mutexes generally aren't.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: