~/talk

Multithreading in UI application: When some threads are more equal than others

Talkat Hydra 2020 · 2020-07-06..07-09· [frontend-architecture, concurrency]
slides:none on file

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

  1. 0:00Intro
  2. 1:24Responsiveness
  3. 1:54Three important limits
  4. 4:11Progress and cancellation
  5. 4:42Non-modal interaction
  6. 5:36Resource utilisation
  7. 6:53Message queue
  8. 9:14Pump messages
  9. 11:25Reentrancy in progress
  10. 12:03NET Approach: COM
  11. 13:10NET Approach: Problem
  12. 14:03NET Approach: Solution
  13. 14:21NET Approach: Locks
  14. 16:58JET: Single thread deadlock
  15. 18:49ReSharper & Rider experience
  16. 19:37Long operations
  17. 21:08Asynchronous world
  18. 23:39Asynchronous 10
  19. 24:51UI Application
  20. 26:15Threading models
  21. 28:17Pessimistic locking Thread A
  22. 31:12Readers-writer lock Thread A
  23. 31:33ContentModelReadWriteLock
  24. 32:49Problems with model
  25. 34:17Smoothness diagnostics
  26. 35:10Consistency diagnostics
  27. 35:45Improvements
  28. 40:55Upgradable RW-lock
  29. 41:46IntellijiDEA experience
  30. 43:24Immutable model
  31. 45:59Immutable TextEditor
  32. 46:52Immutable / Pesistent Tree
  33. 47:40Software transactional memory Transaction 1
  34. 59:43Questions and answers
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.