What are the differences between processes and threads? Compare memory isolation, resource ownership, scheduling, context-switch cost, inter-process communication versus in-process synchronization, failure isolation, and security. When would you choose one over the other in production systems?