Multithreading in UI application: When some threads are more equal than others
summary
Explains why UI code uses a single global read-write lock (IntelliJ model), the real bug class: reentrancy that causes surprising deadlocks in .NET’s lock pumping, and why a six-month effort to move write actions off the UI thread failed in a large IDE. Covers practical tools like Racerd static analyzer and Microsoft trace tools, shows a working immutable approach (text editor using ~2KB blocks → ~1KB allocated per keystroke), reports actor-based BrainSpace failed for distributed deadlocks so they reverted to SQL, and argues for copy/transactional models and event sourcing.
AI-written summary · about
chapters (34)
- 0:00Intro
- 1:24Responsiveness
- 1:54Three important limits
- 4:11Progress and cancellation
- 4:42Non-modal interaction
- 5:36Resource utilisation
- 6:53Message queue
- 9:14Pump messages
- 11:25Reentrancy in progress
- 12:03NET Approach: COM
- 13:10NET Approach: Problem
- 14:03NET Approach: Solution
- 14:21NET Approach: Locks
- 16:58JET: Single thread deadlock
- 18:49ReSharper & Rider experience
- 19:37Long operations
- 21:08Asynchronous world
- 23:39Asynchronous 10
- 24:51UI Application
- 26:15Threading models
- 28:17Pessimistic locking Thread A
- 31:12Readers-writer lock Thread A
- 31:33ContentModelReadWriteLock
- 32:49Problems with model
- 34:17Smoothness diagnostics
- 35:10Consistency diagnostics
- 35:45Improvements
- 40:55Upgradable RW-lock
- 41:46IntellijiDEA experience
- 43:24Immutable model
- 45:59Immutable TextEditor
- 46:52Immutable / Pesistent Tree
- 47:40Software transactional memory Transaction 1
- 59:43Questions and answers
related talks
47m“Multithreading is the answer. What is the question? (part 1 of 2)”
50m“Multithreading is the answer. What is the question? (part 2 of 2)”
25mAdvanced Qt - A Deep Dive 4/6 Multithreading Part 2
58mMultithreading with Qt
50mThe Hidden Art of Thread-Safe Programming: Exploring java.util.con...
51mDevelopment of Multi-threaded applications
39mLet's talk concurrency
48mDebugging Multithreaded Applications
