How (not) to structure applications into threads

Easy ways

Better ways

Server: thread pool, one kernel thread per processor

Interactive application: UI thread plus one thread per processor for processor-intensive work

High-performance computing: use MPI, OpenMP, or other framework for parallelism