Multithreaded Refresher
Summary
Process Thread Relationship
Main process has Stack, Heap, Globals, Constants, and Code sections
Threads have their own stack, but share everything else with main process
Thread Patterns
- Team Model
- Worker pool of threads all feeding from same work queue
- Dispatcher Model
- Dispatcher sits between worker pool and work queue and hands work to workers instead of having them constantly check
- Pipeline Model
- Only one thread pulls from the queue, and every other thread pulls from the previous thread in a line
- Producer-Consumer
- Special case of Team Pool where special thread is feeding the queue