120 likes | 271 Views
How I learned to stop worrying and love the lock. Rob Ennals Intel Research, Cambridge. Locks as an interface ≠ Locks as an implementation. Locks as a programming model – Bad Using locks in the back end – Sometimes good. Atomic ≈ One Big Fat Lock. An easy way to explain transactions
E N D
How I learned to stop worrying and love the lock Rob Ennals Intel Research, Cambridge
Locks as an interface ≠Locks as an implementation Locks as a programming model – Bad Using locks in the back end – Sometimes good
Atomic≈One Big Fat Lock An easy way to explain transactions And often the best way to implement them
Free of Locks ≠ Lock Free Lock freedom – a very useful concept But the name confuses the hell out of people
No Deadlock ≠Lock Free No Deadlock or Livelock - Essential But often fine to wait for another transaction
Respecting Priorities + Lock Free You can’t do both Should high priority transactions block others?
Performance Matters Transactions aid parallelism => parallelism often for performance.
Blocking Perf≥Non-Blocking Perf “blocking” means we allow blocking, not that we require blocking. Respecting priorities can also reduce performance.
What do people actually need? • Non blocking? • Respecting priorities? • IO in transactions? • Nested transactions? Give the people what they want, but no more.
Conclusions Sometimes Non-Blocking is nice But sometimes it isn’t Sometimes Non-Blocking is as efficient as Blocking But sometimes it isn’t Atomicity does not require non-blocking Don’t carry the bathwater round with the baby
Atomic≈Several Smaller Locks With a smart compiler working out what to lock when Some designs may support priorities