Why Threads Are Hard, cont'd
Achieving good performance is hard:
- Simple locking (e.g. monitors) yields low concurrency.
- Fine-grain locking increases complexity, reduces performance in normal case.
- OSes limit performance (scheduling, context switches).
Threads not well supported:
- Hard to port threaded code (PCs? Macs?).
- Standard libraries not thread-safe.
- Kernel calls, window systems not multi-threaded.
- Few debugging tools (LockLint, debuggers?).
Often don't want concurrency anyway (e.g. window events).